Created
January 17, 2014 12:01
-
-
Save anonymous/8472307 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int read_file (char *filename) | |
{ | |
FILE *fin; | |
if ( !(fin = fopen(filename, "r")) ) | |
return -1; | |
/* ... */ | |
return fclose(fin); | |
} | |
int main () | |
{ | |
char filename[100]; | |
if ( read_file(filename) ) | |
{ | |
perror("file.dat"); | |
exit(1); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment