RAD Studio
ContentsIndex
PreviousUpNext
putch

Header File 

conio.h  

Category 

Console I/O Routines 

Prototype 

int putch(int c); 

Description 

Outputs character to screen. 

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.

Note: This function should not be used in Win32 GUI applications.
Return Value 

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

Example  

#include <stdio.h>
#include <conio.h>
int main(void)
{
  char ch = 0;
  printf("Input a string:");
  while ((ch != '\r'))
  {
    ch = getch();
    putch(ch);
  }
  return 0;
}

Portability

POSIX 
Win32 
ANSI C 
ANSI C++ 
 
 
 
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!