一、【比较】:
1、常量指针const char*和char*比较:
1 { 2 3 char *version = "3.0.0"; 4 const char* getversion = 5 RTSP_Pusher_GetPushStreamLibVersion(); 6 char* getvTemp = new char[100]; strcpy(getvTemp, getversion); 7 EXPECT_STRCASEEQ(version, getvTemp); 8 9 }
2、 const char* const* 与 二维字符数组 char* strModel1[] 比较:
1 { 2 3 MODEL_INFO_E category1 = FACE_DETECTION_MODEL; 4 const char* const* getModel1 = manager.GetModelInfo(category1); 5 char* getModelTemp1 = new char[2000]; 6 strcpy(getModelTemp1, (*getModel1)); 7 char* strModel1[] = { "abcacb" }; 8 EXPECT_STRCASEEQ(getModelTemp1, strModel1[0]); 9 10 }
二、【知识 】const char*和char*之间的相互转换: