程序运行错误
#include<stdio.h>#include<stdlib.h>int main(void){ int ch; FILE *fp; long count = 0; char name[41]; printf("input the file's name:"); scanf("%s",name); if ( (fp = fopen(name,"r")) == NULL) { printf ("Can't open %s\n", name); exit(EXIT_FAILURE); } while ((ch = getc(fp)) != EOF) { putc(ch,stdout); count++; } fclose(fp); printf ("\nFile %s has %ld characters\n",name,count); return 0;}
printf ("Can't open %s\n", name); exit(EXIT_FAILURE);