I'm new to C.
Create an array which holds at every index a pointer to another array of dynamic size.
int main()
{
unsigned int i , j;
int* array1[2];
int a1[] = {1,2,3};
int a2[] = {2,3};
array1[0] = a1;
array1[1] = a2;
for (i=0 ; i < 2; i++) {
printf("The value of array1[%d] = %d" , i , *array1[i]);
}
return 1;
}
the value of array1[0] = 1
the value of array1[1] = 2
But similarly doing it directly ,Causing an error.
unsigned int* c[3];
c[0] = {0, 5, 4, 7}; c[1] = {0, 5, 4, 3, 2, 6, 7};
c[2] = {0, 5, 4, 3, 2};
Causing an error : file try.c line xx function main: syntax error before `{'
Why ??
thanks