- Putchar
putchar is a function in
C programming language that writes a single character to the standard output stream,stdout . Its prototype is as follows::int putchar (int character)
The character to be printed is fed into the function as an argument, and if the writing is successful, the argument character is returned. Otherwise,
end-of-file is returned.The
putchar
function is specified in theC standard library header file stdio.h .ample usage
The following program uses
to read characters into an array and print them out using thegetchar putchar
function after anend-of-file character is found.The program specifies the reading length's maximum value at 1000 characters. It will stop reading either after reading 1000 characters or after reading in an end-of-file indicator, whichever comes first.
ee also
*
stdio.h
*C standard library
*getchar References
* [http://www.cplusplus.com/ref/cstdio/putchar.html putchar on Cplusplus.com]
Wikimedia Foundation. 2010.