关于delete
请看代码:
#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 哪里用错了,请指教啊,新手上路~~