← All languages
C function of the day

putchar

Write a single character to stdout.

Description

The putchar() function writes the character c (converted to an unsigned char) to the standard output stream stdout. It is equivalent to putc(c, stdout).

putchar() returns the character written as an unsigned char cast to an int on success, or EOF on error. It is commonly used for character-by-character output.

putchar() is declared in <stdio.h>.

Arguments

NameDescriptionOptional
c The character to write. No

Example

putchar('A');  /* Outputs: A */