Re: multidimensional arrays
Re: multidimensional arrays
- Subject: Re: multidimensional arrays
- From: Andy Armstrong <email@hidden>
- Date: Mon, 14 Mar 2005 20:25:15 +0000
On 14 Mar 2005, at 19:56, Serge Meynard wrote:
You do realize that C fully supports multi-dimensional arrays, you
can do myArray[x][y] in plain C (and Objective-C is super set of C).
Only if your array size is fixed at compile-time. I'm talking about
arrays whose size is only known at execution time, and are allocated
dynamically.
#include <stdlib.h>
int main(void) {
int **x, i;
x = malloc(10 * sizeof(int *));
for (i = 0; i < 10; i++) {
x[i] = malloc(10 * sizeof(int));
}
x[0][0] = 1;
return 0;
}
Looks pretty dynamic to me :)
--
Andy Armstrong, hexten.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden