Debug Assertion Failed! 求教高手!
如题:向高手请教Debug Assertion Failed!
program:D:\AVO.exe
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!
源程序:
void main()
{
int i,j,k;
float par[nc][np];
float x[Ns][L],zb[zbn];
FILE *fp1;
FILE *fp2;
FILE *fp3;
FILE *fp4;
FILE *fp5;
FILE *fp6;
//==== 子程序说明 ====//
void fzb(float zb[zbn]);
void flljl(float x[Ns][L],float zb[zbn],float par[nc][np]);
printf("程序运行请稍后......\n\n");
//======================= 程序主体 =====================//
if((fp1=fopen("地层模型参数表2-1.txt","r"))==NULL)
printf("地层参数文件没有找到!\n");
else
printf("参数文件打开成功!\n");
for(i=0;i<nc;i++)
{
fscanf(fp1,"%f\t%f\t%f\t%f\n",&par[i][0],&par[i][1],&par[i][2],&par[i][3]);
printf("%f m/s\t%f m/s\t%f g/cm3\t%f m\n",par[i][0],par[i][1],par[i][2],par[i][3]);
if(i%2==0)
printf("-R-----------------------------------------------------------R-\n");
}
//======== 子波 =====//
fzb(zb);
fp2=fopen("子波.txt","w+");
for(i=0;i<zbn;i++)
fprintf(fp2,"%f\t%f\n",dt*i,zb[i]);
//==== 计算各道反射系数,形成理论记录,抽道集 ====//
flljl(x,zb,par);
}