【发布时间】:2012-05-06 20:59:02
【问题描述】:
我需要一个 C++ 复习。为什么会出现内存异常?
pear = new char[1024];
pear = "happy go lucky";
delete [] pear; // exception
【问题讨论】:
-
第一行是否等于
char* pear = new char[1024];?
标签: c++ memory runtime-error new-operator delete-operator