C++ <cstdio> - putchar() Function
The C++ <cstdio> putchar() function writes a character to the output stream stdout. It is equivalent to calling putc() function with stdout as second argument.
Syntax
int putchar ( int ch );
Parameters
ch |
Specify a character to be written. |
Return Value
On success, the character ch is returned. On failure, returns EOF and sets the error indicator ferror().
Example:
The example below shows the usage of putchar() function.
#include <cstdio> int main (){ //prints character for(char ch = 'A'; ch <= 'Z'; ch++) putchar(ch); return 0; }
The output of the above code will be:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
❮ C++ <cstdio> Library