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.

Functions for binary streams
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

CHaR
Sitemap Supported
Site format updated 2024-06-05T22:37:07.391+0000
Data updated 1970-01-01T00:00:00.000+0000
Page updated 2022-06-17T21:43:05.000+0000