A stream can be
text or binary. With a binary stream,
there is no transformation between bytes internal and
external to the program. In a text stream, the newline
character '\n'
might be transformed to
some other representation externally, e.g. to a carriage return
and a linefeed on some systems.
To open a stream in binary format, include a
b in the mode
parameter
of fopen
, freopen
, fopen_s
and freopen_s
.
tmpfile
always opens a binary stream.
Name | Description | Notes | Source | Availability | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
fgetc() |
Input character | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
fgets() |
Input line of characters | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
fputc() |
Output character | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
fputs() |
Output line of characters | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
fread() |
Input bytes | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
fwrite() |
Output bytes | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
getc() |
Input character | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
getchar() |
Input character from standard input | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
gets() |
Input line of characters from standard input | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | ||||
gets_s() |
Input line of characters from standard input | ? | (·) | <stdio.h> |
C11 | ||||||
putc() |
Output character | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
putchar() |
Output character to standard output | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
puts() |
Output line of characters to standard output | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
ungetc() |
Replace character | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 |