Borland C++ reference

putch

raw OCR

Outputs character to screen.

Defined in header <conio.h>

Syntax

#include <conio.h>
int putch(int c);

Portability

DOSUNIXWindowsANSI CC++ only
■

Remarks

putch outputs the character c to the current text window. It is a text mode function performing direct video output to the console, putch does not translate linefeed characters (\n) into carriage-return/linefeed pairs.

The string is written either directly to screen memory or by way of a BIOS call, depending on the value of the global variable directvideo.

Return value

On success, putch returns the character printed, c. On error, it returns EOF.

See also

Example

#include <stdio.h>
*include <conio.h>

int main(void)
{
   char ch = Oj-
   printf ("Input a string:");
   while ((ch != '\r'))  {
      ch = getch 0;
      putch(ch);
   }
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.