1.获取二维字符数组元素个数的方法:
char* str[4];
int arrSize=sizeof(str);//16B
int subArrSize=sizeof(str[0]);//4B
int count=arrSize/subArrSize;//4
2.判断二维字符数组是否结束的方法:
char **pp=str;
if(strcmp(*pp,"\0")==0)//ok
{}
或
if(strcmp(*pp,"")==0)//ok
{}
错误写法:
if(*pp=="\0")//error,不能直接通过 ==判断是否和"\0"相等!
{}