WinCE下指针取值问题
我写了个测试程序,在VC下可以执行,但是用2440的sdk、VS2005和WINCE6.0的模拟器,单步执行到a = *p; 执行到这里,就不往下执行了,请教大家一下。
void CTest5Dlg::OnTest()
{
unsigned char *buf;
unsigned long a;
unsigned long *p;
int i;
CString s;
buf = (unsigned char *)malloc(100);
for (i=0;i<100;i++)
{
buf[i] = i;
}
p = (unsigned long *)(buf+1);
a = *p; // 执行到这里,就不往下执行了
s.Format(_T("a = 0x%08X"), a);
AfxMessageBox(s);
}