求助啊,关于stream!=NULL的问题
单击菜单按钮plot,我把aaa.dat文件中的数据读取出来,然后在view中画图,再接着单击save按钮,弹出对话框保存所画的图形,保存完后我再次单击plot读取数据画图时,出现错误:
File:fscanf.c
Line:54
Expression: stream!=NULL
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the appliction)
读取文件的代码如下:
CString filename;
FILE *fp;
int i,j;
filename=".\\data\\aaa.DAT";
fp=fopen(filename,"r");
if(!fp)
MessageBox("打开文件错误!");
if( fp != NULL )
{
for(i=0;i<349;i++)
for(j=0;j<550;j++)
{
fscanf(fp,"%f",&Ex[i][j]);
}
fclose(fp);
}
第一次读取数据画图时,没有问题,将图形保存后,再次画图读取数据就有问题,会弹出对话框“打开文件错误”!请问下该怎么解决这个问题啊?