看返回是否是 NULL。例如:if ( (fin = fopen(namein,"rb" )) == NULL ) {printf("Cann't open input file: %s\n",namein); exit(1);};例如:fp = fopen("a.txt","r");if (!fp) printf("fopen a.txt error !\n");