所以这是我的代码
int main(int argc, char *argv[] )
{
double mass1, mass2, tof, pixcm;
char pofVfilename[50];
double pix[50];
double pofV[50];
if(argc != 2)
{
printf("usage: %s filename", argv[0]);
}
else
{
FILE *file = fopen(argv[1], "r");
if(file == 0){
printf("could not open file\n");
}
else{
fscanf(file, "%lf %lf", &mass1, &mass2);
fscanf(file, "%lf", &tof);
fscanf(file, "%s", pofVfilename);
fscanf(file, "%lf", &pixcm);
fclose(file);
printf("%lf%lf%lf%lf", mass1, mass2, tof, pixcm);
readinputpofV(pix, pofV, pofVfilename);
printf("%f %f", pix[10], pofV[10]);
}
}
return 0;
}
void readinputpofV(double pix[], double …Run Code Online (Sandbox Code Playgroud)