linux下如何实现windows的system(“pause”)

来源:互联网 发布:能看禁播视频的软件 编辑:程序博客网 时间:2024/06/01 08:07
printf("Press any key to continue") ;struct termios te;int ch;tcgetattr( STDIN_FILENO,&te);te.c_lflag &=~( ICANON|ECHO);tcsetattr(STDIN_FILENO,TCSANOW,&te);tcflush(STDIN_FILENO,TCIFLUSH);fgetc(stdin) ; te.c_lflag |=( ICANON|ECHO);tcsetattr(STDIN_FILENO,TCSANOW,&te);
0 0
原创粉丝点击