how to initialize 2D array.
following is not a code but just for my concept, plz tell if it is correct
n how
array having x rows n y columns
array=(int **)malloc(x*sizeof(int *)
for(i=0;i<;i++)
array[i]=(int *)malloc(y*sizeof(int))
thanks
Printable View
how to initialize 2D array.
following is not a code but just for my concept, plz tell if it is correct
n how
array having x rows n y columns
array=(int **)malloc(x*sizeof(int *)
for(i=0;i<;i++)
array[i]=(int *)malloc(y*sizeof(int))
thanks
Yes, just like that, without the casts.
Numerous posts (some of them very recent) show you how.