标签:mamicode not inf erro fopen open scanf error code
#include<stdlib.h>
int main(void)
{
FILE * fp;
int i,m,n;
int a[5];
if((fp=fopen("C:\\ha\\ha.txt","r+"))==NULL){
printf("File open error!\n");
exit(0);
}
for(i=0;i<5;i++)
{
fscanf(fp,"%d",&a[i]);
}
m=a[0];
for(i=0;i<5;i++) {
if(m<a[i])
m=a[i];
n=i;
}
fprintf(fp,"\n%d %d",m,n);
if(fclose(fp)){
printf("Can not close the file!\n");
exit(0);
}
return 0;
(2)
(3)
标签:mamicode not inf erro fopen open scanf error code
原文地址:https://www.cnblogs.com/wsxjydbb/p/10502727.html