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