#include<stdio.h> #include <conio.h> void open() { FILE *in; if((in=fopen("stu.dat","rb"))==NULL) { printf("not exist\n"); return; } fclose(in); } void main() { open(); getch(); }
#include <stdio.h> #include <conio.h> #include <stdlib.h> void open(void) { FILE *in; if((in=fopen("stu.dat","rb"))==NULL) { printf("not exist\n"); exit(0); } fclose(in); } void main() { open(); getch(); }