关于delete

tiandiyishaou2010 tiandiyishaou2010 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
请看代码:
#include "stdafx.h"
#include <iostream>
using namespace std;
const int m=5;
void main()
{
char re[m];
cin.getline(re,m,'#');
puts(re);
delete []re;
system("pause");
}

我在控制台输入的是:wangfeng
结果:wang
Debug Assertion failed
Expression:_BLOCK_TYPE_IS_VALID(pHead_>nBlockUse)
For information on how your program can cause an assertion failure,see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
..........

我的delete 哪里用错了,请指教啊,新手上路~~


...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
tiandiyishaou2010
C++ 语言 65,214 成员 250,514 内容