Table of Contents

putch

int putch(int c);

description of putch

prints characters on the screen.

putch gives the character c to the current text window. It is a text-mode function that displays output directly to the console.
putch replaces the newline character (\ n) characters are not merchandise return / line feed.

Depending _directvideo of the global variable, the string is written either directly or through a BIOS call to screen memory.

Return values: success the character, failure EOF

#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;
 }

output of putch c example

  Input a string: test123
  test123