标题:vc++6.0下运行调试总是输出:printf("format error!\n"); 大神助我呀!怎样 ...
取消只看楼主
z_j_j_1
Rank: 4
等 级:业余侠客
威 望:1
帖 子:62
专家分:213
注 册:2015-4-4
结帖率:50%
已结贴  问题点数:20 回复次数:0 
vc++6.0下运行调试总是输出:printf("format error!\n"); 大神助我呀!怎样操作才能让程序正常运行呢?
怎样操作才能让程序正常运行呢?

#include<stdio.h>
#include<stdlib.h>

int main(int argc,char *argv[])
{
    int c;
    FILE *fp;
    if(argc!=2)
    {
        printf("format error!\n");
        //while(1);
        exit(0);
    }
    if( (fp=fopen(argv[1],"r"))==NULL )
    {
        printf("file can not open!\n");
        //while(1);
        exit(0);
    }
    while( (c=fgetc(fp))!= EOF )
        fputc(c,stdout);
    //while(1);
    fclose(fp);
    while(1);
    return 0;
}
搜索更多相关主题的帖子: include return file 
2015-05-07 10:27



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-444944-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.731067 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved