按任意键返回(退出)
来源:互联网 发布:mac outlook 默认字体 编辑:程序博客网 时间:2024/05/20 23:57
#include <stdio.h>#include <termios.h>#include <unistd.h>int getch(){ struct termios tm,tm_old; int fd = STDIN_FILENO,c;setbuf(stdin,NULL); if (tcgetattr(fd, &tm) < 0) { return -1; } tm_old = tm; cfmakeraw(&tm); if (tcsetattr(fd,TCSANOW, &tm) < 0) { return -1; } c = fgetc(stdin); if (tcsetattr(fd,TCSANOW,&tm_old) < 0) { return -1; } return c;}int main(){system("clear");printf("按任意键退出。。。\n");getch();return 0;}
0 0
- 按任意键返回(退出)
- 按返回键退出
- 按两次返回键退出
- andoird 按返回键退出
- 按 两次 返回键 退出
- 按两次返回键退出
- 按返回键退出程序
- android (三) 禁止按返回键,退出系统。
- 简单的Demo(按两次返回键退出)
- android开发:退出程序(对话框、两次返回键退出)
- android开发:退出程序(对话框、两次返回键退出)
- C# 实现控制台应用程序按任意键退出
- BAT执行文件 按任意键开始退出
- BAT执行文件 按任意键开始退出
- Linux 下 Python 实现按任意键退出
- 按返回键,提示是否退出程序
- android 按两次返回键退出
- android 按两次返回键退出程序
- 角点检测
- TCP/IP、Http、Socket的区别
- Servlet之二 —— HttpServlet的doGet()和doPost()
- android thread Handler 、Looper、 Message、 Message Queue
- 过滤器
- 按任意键返回(退出)
- 最最常用的100个Java类
- Insertion Sort List
- Leetcode Best Time to Buy and Sell Stock II
- 线程返回值的方式介绍
- POJ 3304 Segments [判断线段和直线相交]
- VIM插入时间
- 为Ubuntu安装翻译词典(星际译王)
- 【Codeforces】Codeforces Round #271 div2