#include <stdio.h> #include <stdlib.h> int main(void) { FILE *fp; fp=fopen("c:\\Chapter01.exe","r"); if(fp==NULL) { printf("Cannot open file!\n"); getchar(); exit(1); } printf("Open the file successfully!\n"); fclose(fp); return 0; }