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;
}