CString与Byte数组的相互转化

    技术2022-05-11  11

     CString cs1 = "gettruckpos";

     byte buf[200];

     memcpy(buf,cs1.GetBuffer(cs1.GetLength()),cs1.GetLength());  //将cstring放入byte数组

     CString *pPhoneNum =new CString((char*)buf, cs1.GetLength()); //将byte数组转换成cstring

     CString cs2 = *pPhoneNum;

     


    最新回复(0)