⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_64965.htm

📁 vc
💻 HTM
字号:
<p>
序号:64965 发表者:wanlei 发表日期:2003-12-14 20:00:03
<br>主题:请教CArray&lt;int,int&amp;&gt;数组用后需要析构吗?
<br>内容:用typedef CArray&lt;int,int&amp;&gt;intArray定义了一个CArray结构,然后在一个函数里面设置<BR>m_pIntArray=new intArray;我现在想问一个问题就是m_pIntArray按道理是在heap里分配的内存。需要在desconstructure吗?如果要应该怎么析构。我记得CArray类中没有析构函数。程序在退出时都出错:_CrtIsValidHeapPointer(pUserData)
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:BigJames 回复日期:2003-12-16 11:36:09
<br>内容:直接delete。<BR>我是过下列代码,没有问题:<BR>#include &lt;afxtempl.h&gt;<BR>typedef CArray&lt;int,int&amp;&gt;intArray;<BR>m_pIntArray=new intArray;<BR>delete m_pIntArray;<BR><BR>如果你的程序确实是因为这块出的错,也许可以考虑安装一下vc6sp5
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -