|
|
Files - Opening |
|
#include <stdio.h>
FILE* fopen ( char* name, char* mode )
Open a file and return a FILE pointer using the given mode. If there's a problem opening the file, the function will return NULL.
The mode is some combination of the three characters "w", "r", "a", and (on some systems) "b".
| "w" | open for write |
| "r" | open for read |
| "a" | open for appending |
| "wa" | open for write, appending to existing data. |
| "rw" | open for read and write |
| "b" | Open in binary mode. Usually the default and only required on some systems. |
There are more combinations of the letters w, r, a, and b but these are the most common.