Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

putchar, putchar_unlocked - put byte on standard output stream (thread-safe)

&pagelevel(4)&pagelevel

Syntax

#include <stdio.h>

int putchar(int c);

int putchar_unlocked(int c);

Description

The function call putchar(c) is equivalent to putc(c, stdout). putchar() is implemented both as a function and as a macro.

The function putchar_unlocked() (see under getc_unlocked()) is functionally equivalent to putchar() except that it’s implementation is not thread-safe. For this reason it can only be used safely in a multithreaded program if the thread that calls it owns the corresponding (FILE *) object. This is the case after successfully calling the flockfile() or ftrylockfile() functions.

Return val.

See fputc().

Notes

The bytes are not written immediately to the external file but are stored in an internal C buffer (see section “Buffering streams”).

For further information on output to text files and on converting control characters for white space (\n, \t, etc.), see section “White-space characters”.

The program environment determines whether putchar() is executed for a BS2000 or POSIX file.

See also

getchar(), getchar_unlocked(), putc(), putc_unlocked(), stdio.h.