从指定内存地址中读取字符串的乱码问题,解决马上结贴!
我有一个函数
WriteBytes(const void *buf, int cnt)
其中
buf:Pointer to the bytes to write out
cnt:length of buffer (which is treated as the number of bytes to write)
我想用以下的方法把buf里面的字符串读出来
cstring m_str;
m_str.Format(_T("%s"), (ACHAR *)buf);
TCHAR *p = (TCHAR *)buf;
char *p1 = (char *)buf;
等都失败了,得出的是乱码
请问这是什么原因,请指教,谢谢!