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;
原文地址:http://blog.youkuaiyun.com/wangandy7811/article/details/4619930
本文详细介绍了如何使用C++将CString转换为byte数组,并通过memcpy进行数据复制,最后将byte数组转换回CString的过程。适用于需要在C++中进行字符串和字节数据交互的场景。
5019

被折叠的 条评论
为什么被折叠?



