Files and IO streams

suggest change

Syntax

Parameters

Parameter | Details |

——— | —–– |

const char *mode | A string describing the opening mode of the file-backed stream. See remarks for possible values. | int whence | Can be SEEK_SET to set from the beginning of the file, SEEK_END to set from its end, or SEEK_CUR to set relative to the current cursor value. Note: SEEK_END is non-portable.|

Remarks

Mode strings:

Mode strings in fopen() and freopen() can be one of those values:

Each of these file modes may have a b added after the initial letter (e.g. "rb" or "a+b" or "ab+"). The b means that the file should be treated as a binary file instead of a text file on those systems where there is a difference. It doesn’t make a difference on Unix-like systems; it is important on Windows systems. (Additionally, Windows fopen allows an explicit t instead of b to indicate ‘text file’ — and numerous other platform-specific options.)

The x, if present, must be the last character in the mode string.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents