Re: Simple Array
Re: Simple Array
- Subject: Re: Simple Array
- From: Nicolai <email@hidden>
- Date: Thu, 20 Sep 2001 19:04:30 +0200
But when I'm using NSArray it might be a bit slower.
In my source I will implement it, where I have to
access the array maybe 100.000.000 times.
So it has to be fast.
Am I right? Why shouldn't I use calloc an free?
Greetings, Nicolai.
First, DON'T DO THAT -- use NS(Mutable)Array instead.
If you insist, though, it is almost the same, but for the new/delete
operators which must be replaced by the standard ANSI malloc or
calloc/free:
double * pDoubleArray;
pDoubleArray = calloc(size, sizeof(*pDoubleArray)); // sizeof(double)
would
work as well, but this is better if you happen to change the source
pDoubleArray[position] = dNumber;
free(pDoubleArray);
pDoubleArray = NULL;
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc