<cstdio>
int putchar ( int character );
Write character to stdout
Writes character to the current position in the standard output (stdout) and advances the internal file position indicator to the next position.
It is equivalent to putc(character,stdout).
Parameters
- character
- Character to be written. The character is passed as its int promotion.
Return Value
If there are no errors, the same character that has been written is returned.
If an error occurs, EOF is returned and the error indicator is set.
Example
1 2 3 4 5 6 7 8 9 10 11
|
/* putchar example: printing alphabet */
#include <stdio.h>
int main ()
{
char c;
for (c = 'A' ; c <= 'Z' ; c++) {
putchar (c);
}
return 0;
}
|
This program writes ABCDEFGHIJKLMNOPQRSTUVWXYZ to the standard output.
See also
putc | Write character to stream (function) |
fputc | Write character to stream (function) |
getchar | Get character from stdin (function) |
|