文件操作问题求救!谢了!
ra3 2002-05-17 07:03:20
请大家帮我看一下这个程序,编译时也对,也能够输出结果,可是在运行时(输出结果后),会出现一个调试错误的对话框。
应该怎么办?
////////////////////////////////////////////////////////////////////
Microsoft Visual C++ Debug Library
Debug Error!
Program: E:\TEMP\LX195.EXE
DAMAGE: after Normal block (#24) at 0x00790CF0.
(Press Retry to debug the application)
终止(A) 重试(R) 忽略(I)
///////////////////////////////////////////////////////////////////
#include <iostream.h>
#include <fstream.h>
void main()
{
ifstream infile("Address.txt");
char * cs=new char[sizeof(infile)];
int i=0;
while (infile.get(cs[i]))
{
i++;
}
infile.close();
cout<<cs<<endl;
delete[] cs;
}