#include
#include
#define X 256
#define Y 256
void main()
{
static float V[X][Y]={0};
static float D[X][Y]={0};
FILE *fp1,*fp2;
float REF(float V[X][Y],float D[X][Y]);
int i,j;
fp1=fopen("C:\\Users\\地层速度模型.txt","r");
fp2=fopen("C:\\Users\\地层密度模型.txt","r");
for(i=0;i
for(j=0;j
fscanf(fp1,"%f\t",&V[i][j]);
fscanf(fp2,"%f\t",&D[i][j]);
}
}
fclose(fp1);
fclose(fp2);
REF(V,D);
}
void REF(float V[X][Y],float D[X][Y])
{
int i,j;
static float ref[X][Y]={0};
for(i=0;i
for(j=0;j
ref[j][i]=(V[j+1][i]*D[j+1][i]-V[j+1][i]*D[j+1][i])/(V[j][i]*D[j][i]+V[j][i]*D[j][i]);
}
}
for(i=0;i
for(j=0;j
printf("%f\t",ref[i][j]);
}
}
}
编译无错误运行
--------------------Configuration: demo - Win32 Debug--------------------
Linking...
demo.obj : error LNK2001: unresolved external symbol "float __cdecl REF(float (* const)[256],float (* const)[256])" (?REF@@YAMQAY0BAA@M0@Z)
Debug/demo.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
demo.exe - 2 error(s), 0 warning(s)