小编use*_*320的帖子

C中的冲突类型错误与某些文件io

所以这是我的代码

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)

c compiler-warnings

2
推荐指数
1
解决办法
1614
查看次数

标签 统计

c ×1

compiler-warnings ×1