This shows you the differences between two versions of the page.
c:keywords:file [2013/06/24 20:26] 141.219.21.27 Better description |
c:keywords:file [2024/02/16 01:05] (current) |
||
---|---|---|---|
Line 15: | Line 15: | ||
- | int main ( void ) | + | int main (void) |
{ | { | ||
- | FILE *filestream; | + | FILE *filestream; |
- | filestream=fopen("test.txt","r"); | + | filestream=fopen("test.txt","r"); |
- | if (filestream == 0) { | + | if (filestream == NULL) |
- | perror("cannot open file"); | + | perror("cannot open file"); |
- | } | + | |
- | + | ||
- | fclose(filestream); | + | |
- | return 0; | + | |
+ | fclose(filestream); | ||
+ | return 0; | ||
} | } | ||
</code> | </code> |