Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <unistd.h>
- #include <termios.h>
- int getch ( void ) {
- int ch;
- struct termios origterm, tmpterm;
- tcgetattr ( STDIN_FILENO, &origterm );
- tmpterm = origterm;
- tmpterm.c_lflag &= ~( ICANON | ECHO );
- tcsetattr ( STDIN_FILENO, TCSANOW, &tmpterm );
- ch = getchar();
- tcsetattr ( STDIN_FILENO, TCSANOW, &origterm );
- return ch;
- }
- int main() {
- int a = 1;
- printf("%d", a);
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement