Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<errno.h>
- #include<stdio.h>
- #include<stdlib.h>
- #include<string.h>
- FILE *
- open_sesame (char *name)
- {
- FILE *stream;
- errno = 0;
- stream = fopen (name, "r");
- if (stream == NULL)
- {
- fprint (stderr, "%s: Couldn't open file %s; %s\n",
- program_invocation_short_name, name, strerror (errno));
- exit (EXIT_FAILURE);
- }
- else
- return stream;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement