读书人

PBYTE的有关问题

发布时间: 2012-02-26 20:19:43 作者: rapoo

PBYTE的问题
CString str = "hello123 ";
PBYTE * pByte = (PBYTE *)str.GetBuffer(str.GetLength());
int nTemp = 0;
str.ReleaseBuffer();
while (*pByte!= '\0 ') {
nTemp++;
pByte++;
}
我想得到pByte里面的字符个数,但pByte++;一下把指针后移4个位置

[解决办法]
PBYTE * pByte = (PBYTE *)str.GetBuffer(str.GetLength());

改成

PBYTE pByte = (PBYTE )str.GetBuffer(str.GetLength());
[解决办法]
PBYTE pByte = (PBYTE )str.GetBuffer(str.GetLength());

PBYTE 就已经是 指针了 ...

读书人网 >C++

热点推荐