首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

PBYTE的有关问题

2012-02-26 
PBYTE的问题CStringstrhello123 PBYTE*pByte(PBYTE*)str.GetBuffer(str.GetLength())intnTemp0str

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 就已经是 指针了 ...

热点排行