Actually you have answered you question in your question itself.
char *str[]={"hi", "all"};
This code creates an array of pointers to char, and makes the pointers point to the character arrays "hi" and "all", respectively. Now, my question is regarding the following code:
Code:
int intarr[2][2]={{1,2} , {3,4}};
int *intptr[]=intarr; // created an array of pointers to int :
that's fine but does the pointers point to int array ?
// int *intptr[ ] = { intarr[0] , intarr[1] }; // to be equalivent to string analogy
Are you doing the same thing here?
Also if you have
Code:
char char_arr[2][100] = { { 'h','i',\0'} , { 'a', 'l', 'l','\0'} };
char *char_ptr[] = char_arr; // will it work?
or char (*char_ptr)[2] = char_arr; // or this ?