Thanks!
One other question if you wouldn't mind indulging me.
Code:
Code:
int main(int argc, char * argv[]) {
int a = 5;
int b = 6;
void ** pointers = malloc(2 * sizeof(void *));
pointers[0] = &a;
pointers[1] = &b;
int test[2];
test[0] = 4;
test[1] = 8;
printf("%lu\n", sizeof(test) / sizeof(int) );
printf("%lu\n", sizeof(pointers));
printf("%lu\n", sizeof(pointers) / sizeof(void *));
printf("%lu\n", sizeof(*pointers) / sizeof(void *));
return 0;
}
Is it possible to get the number of items for dynamic arrays like this? I can do it with the var "test" above, but am not sure if you can even do it with the "pointers" var.
Thanks again