c:error_checking
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| c:error_checking [2016/07/02 00:44] – created peter | c:error_checking [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| <code c> | <code c> | ||
| - | | + | #include < |
| - | #include < | + | #include < |
| - | #include < | + | #include < |
| - | #include < | + | #include < |
| - | | + | int main() |
| - | { | + | { |
| - | FILE *fp; | + | FILE *fp; |
| - | char errmsg[200]; | + | char errmsg[200]; |
| - | | + | |
| - | if (fp == NULL) { | + | if (fp == NULL) { |
| - | perror(" | + | perror(" |
| - | /* | + | /* |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | exit(EXIT_FAILURE); | + | |
| - | } | + | } |
| - | return 0; | + | |
| - | } | + | |
| + | } | ||
| </ | </ | ||
c/error_checking.1467420253.txt.gz · Last modified: 2020/07/15 09:30 (external edit)
