Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <unistd.h>
  3. #include <termios.h>
  4.  
  5. int getch ( void ) {
  6. int ch;
  7. struct termios origterm, tmpterm;
  8.  
  9. tcgetattr ( STDIN_FILENO, &origterm );
  10. tmpterm = origterm;
  11. tmpterm.c_lflag &= ~( ICANON | ECHO );
  12. tcsetattr ( STDIN_FILENO, TCSANOW, &tmpterm );
  13. ch = getchar();
  14. tcsetattr ( STDIN_FILENO, TCSANOW, &origterm );
  15.  
  16. return ch;
  17. }
  18.  
  19. int main() {
  20.  
  21. int a = 1;
  22. printf("%d", a);
  23.  
  24. getch();
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement