Use the getch() function to read \n, return character - C Data Type

C examples for Data Type:char

Description

Use the getch() function to read \n, return character

Demo Code

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

int main( void )
{
     int ch;/*from ww w . j  a  va 2  s  .c  o m*/

     while ((ch = getche()) != '\n')
         putchar(ch);

     return 0;
}

Related Tutorials