{
char cEntityID[32];
std::string strEntityID;
//当cEntityID的值为32位时(即:填满整个空间);
//cEntityID的最后一位‘\0’是没有的;
//所以不能直接转换,转换方式如下:
char * tempBuff[33] = {0};
memcpy( tempBuff, cEntityID, 32 );
strEntityID = ( const char * )tempBuff;
}
{
char cEntityID[32];
std::string strEntityID;
//当cEntityID的值为32位时(即:填满整个空间);
//cEntityID的最后一位‘\0’是没有的;
//所以不能直接转换,转换方式如下:
char * tempBuff[33] = {0};
memcpy( tempBuff, cEntityID, 32 );
strEntityID = ( const char * )tempBuff;
}