cannot convert parameter 1 from 'char'
#include<stdio.h>#include<stdlib.h>#defineBUFSIZE256main(){charbuff[BUFSIZE],file;int...
#include <stdio.h>
#include <stdlib.h>
#define BUFSIZE 256
main()
{ char buff[BUFSIZE],file;
int c,lcnt;
FILE *fp;
puts("Input the file name:");
scanf("%s",file);
if((fp=fopen(file,"r"))==NULL)
{
printf("\7file %s can't opened\n",file);
exit(1);
}
lcnt=1;
while(fgets(buff,BUFSIZE,fp)!=NULL)
printf("%3d:%s",lcnt++,buff);
fclose(fp);
return 0;
} 展开
#include <stdlib.h>
#define BUFSIZE 256
main()
{ char buff[BUFSIZE],file;
int c,lcnt;
FILE *fp;
puts("Input the file name:");
scanf("%s",file);
if((fp=fopen(file,"r"))==NULL)
{
printf("\7file %s can't opened\n",file);
exit(1);
}
lcnt=1;
while(fgets(buff,BUFSIZE,fp)!=NULL)
printf("%3d:%s",lcnt++,buff);
fclose(fp);
return 0;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询