Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <termios.h>
- #include <unistd.h>
- struct termios savedterm;
- void initterm ()
- {
- struct termios outterm;
- setbuf(stdin, NULL);
- tcgetattr(fileno(stdin), &savedterm);
- outterm=savedterm;
- outterm.c_lflag &= ~(ECHO | ICANON);
- outterm.c_iflag &= ~ICRNL;
- outterm.c_cc[VMIN]=1;
- outterm.c_cc[VTIME]=0;
- tcsetattr(fileno(stdin), TCSANOW, &outterm);
- }
- int main (int argc, const char *argv[])
- {
- initterm();
- char c;
- read(fileno(stdin), &c, 1);
- printf("**********\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement