Hi,
I have some question in ** .I think the type of element in arr2 is CCARRY that is const char* [10].But it is const char *,why?
And ,if the type of element in arr2 is const char* as compiler said in 1**,why in 2** compiler think the type of element in arr2 is const char* [10]?
PS:I believe the type of element in arr2 is const char* [10].
My test environment is vs2008 and GCC4.4.0
Code:
typedef const char* CCARRY[10]; char * p="Hello"; p = "Merry"; CCARRY arr1={p};//OK using the type of char * to initialize to type of const char * arr1[0]=p;//OK,assignment CCARRY arr2[5]={arr1};//1**compile error:cannot convert 'const char**' to 'const char*' in initialization CCARRY arr3[5]={*arr1};//3**ok,right arr3[5]=*arr1;//2**compile error:incompatible types in assignment of 'const char*' to 'const char* [10]
And ,if the type of element in arr2 is const char* as compiler said in 1**,why in 2** compiler think the type of element in arr2 is const char* [10]?
PS:I believe the type of element in arr2 is const char* [10].
My test environment is vs2008 and GCC4.4.0
Comment