Name
putch - Writes a character to the console.
Syntax
#include <conio.h>
int putch(c)
int c;
Description
The putch function writes the character c directly to the
console.
Return Value
The function returns c if successful, and EOF if not.
See Also
cprintf(DOS), getch(DOS), getche(DOS)
Example
#include <conio.h>
mygetche()
{
/* Get a character with no echo */
int ch = getch();
/* Send the character to the console */
putch(ch);
return(ch);
}
main()
{
char ch;
while (( ch = mygetche()) != '\r');
}
This program uses getch and putch to read and echo
characters until the \r escape sequence is entered. Normally
the getche function would be used to accomplish this.
(printed 6/18/89)