const char *cmdMsgString[] = {
"OK",
"ERROR",
"RING",
"RING&CID",
"CFGTDM"
};
#if 1//test
printf("----------------------------------------------\n");
printf("string : %s\n",(string)); //CFGTDM
printf("strlen(string) : %d\n",strlen(string)); //6
printf("sizeof(string) : %d\n",sizeof(string)); //4
printf("sizeof(*string) : %d\n",sizeof(*string)); //1
printf("*(char *)(string+1) : %c\n",*(char *)(string+1)); //F
printf("\n");
printf("(cmdMsgString[4]) : %s\n",(cmdMsgString[4])); //CFGTDM
printf("strlen(cmdMsgString[4]) : %d\n",strlen(cmdMsgString[4])); //6
printf("sizeof(cmdMsgString[4]) : %d\n",sizeof(cmdMsgString[4])); //4 == sizeof(char *)
printf("strlen(cmdMsgString) : %d\n",strlen(cmdMsgString)); //2 == strlen(cmdMsgString[0]) == strlen("OK")
printf("sizeof(cmdMsgString) : %d\n",sizeof(cmdMsgString)); //20
printf("sizeof(*cmdMsgString[4]) : %d\n",sizeof(*cmdMsgString[4]));//1 == sizeof(char)
printf("*(char *)(cmdMsgString[4]+1) : %c\n",*(char *)(cmdMsgString[4]+1));//F
printf("----------------------------------------------\n");
#endif