-
-
Save rhoit/6055769 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Title: Configuration for OS | |
Started: Oct 2008 | |
Last Update: 9 Oct 2008 | |
Revised: 0 | |
Program Status: Test mode | |
Pipeline: None till date | |
*/ | |
#ifdef MSWin | |
#include<conio.h> | |
#define cls system("cls") | |
#else | |
#define cls system("clear") | |
#include <termios.h> | |
#include <unistd.h> | |
int getch() | |
{ | |
struct termios oldt, | |
newt; | |
int ch; | |
tcgetattr(STDIN_FILENO, &oldt); | |
newt= oldt; | |
newt.c_lflag &= ~(ICANON| ECHO); | |
tcsetattr(STDIN_FILENO, TCSANOW, &newt); | |
ch= getchar(); | |
tcsetattr(STDIN_FILENO, TCSANOW, &oldt); | |
return ch; | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment