摘要:
问题如下:我定义了如下的一个结构体:typedef struct{ CString csText;}MyStruct;并有如下的程序段1:MyStruct * p=NULL;p=(MyStruct *)malloc(sizeof(MyStruct));if(!p) AfxMessageBox("分配内存失败!");else{ p->csText="hello world!"; free(p);}执行程序段1,会出现一个内存读取异常,系统提示程序非法read了一个地址。换成如下写法也是错的:MyStruct astruct;astruct.csTex 阅读全文
posted @ 2013-06-23 16:20
编程小翁
阅读(3358)
评论(0)
推荐(0)

浙公网安备 33010602011771号