getche gets a character from console, and echoes to the screen
Declaration:
int getche(void);
Remarks:
getche reads a single character from the keyboard and echoes it to the
current text window, using direct video or BIOS.
Return Value:
Both functions return the character read from the keyboard.
program
#include <stdio.h>
#include <conio.h>
int main(void)
{
char ch;
printf("Input a character:");
ch = getche();
printf("\nYou input a '%c'\n", ch);
return 0;
}
}
0 comments:
Post a Comment