Hi, I basically want to dynamically allocate an array, and then pass this pointer on, but I don't want to pass any specific size along, I just want to use a sentinal to mark the end of the array.
I thought calloc would do it, but it doesn't...
It just basically goes on forever... i should stop at the first element.....Code:int main() { struct test { int number; int list[10]; }; typedef struct test test; test * list = (test*)calloc(10, sizeof(test)); int i = 0; while(&list[i] != NULL) { printf("list index %d is not null.\n",i); i++; } return 0; }
Any advice?