dynamic arrays
I have array of pointers which points to arrays.
1 2 3 4
|
int *point_to,*temp;
point_to=(int*)malloc(sizeof(int*)*5);
temp=(int)malloc(sizeof(int)*6);
point_to[0]=&temp;
|
Now, how do I access the array of integers from the point_to?
point_to is a pointer to an int, not a pointer to a pointer to an int.
Rewrite the declaration as
int **point_to,*temp;
Now, how do I access the array of integers from the point_to? |
point_to[0][0]. The first is the index of the outer array and the second is the index for the inner array.
of course! thanks helios
Topic archived. No new replies allowed.