Linux 下getch()和getche()
Linux下getch()和getche()
I would recommend never mixing input techniques in a program. Don't mix fgets() or scanf() with getchar(). Don't mix any standerd C library input function with a non-standard function that bypasses the C stream mechanism, be that getch(), getche(), bioskey(), or anything else. Note that these functions do not read from stdin, they read from a hardware keyboard, which is not the same thing.
Functions like getch() and getche() haven't been incorporated into the C standard because not all host systems provide ways to turn off input buffering. Thus compilers include these as common extensions wherever possible.
It is worth pointing out that writing Standart C (or Standart POSIX or whatever) is not always useful or desirable. It is up to the programmer to decide when and whether the benefits of sticking to any particular standards are worth their costs. But in order to make such a decision (and execute it), information *about* those standards is very important.
希望大家能够写出自己的getch() or getche()。
以上是在网站http://bytes.com上的摘录,链接为http://bytes.com/topic/c/answers/476130-getch-getche
相关文档:
Linux安装JDK步骤1. 先从网上下载jdk(jdk-1_5_0_02-linux-i586.rpm) ,推荐SUN的官方网站www.sun.com,下载后放在/home目录中,当然其它地方也行。
进入安装目录
#cd /home
#cp jdk-1_5_0_02-linux-i586.rpm /usr/local
#cd /usr/local
给所有用户添加可执行的权限
#chmod +x jdk-1_5_0_02-linux-i586.rpm.bin
#./jd ......
我把我整合apache+tomcat+mod_webapp.so的过程发上来。其中包括了许多前人的心得与经验
1.所需的软件包
j2sdk-1_4_1_02-linux-i586.bin(jdk1.4.1)
Apache2.0.40 (Red Hat Linux8.0自带)   ......
Linux版本2.6.27更新后,人们发现,这一内核的源代码数量已经超过了1000万行.
当然,这些行数仅仅是计算机统计出来的行数,包括空白行,为了代码的可读性增加的注释等,当然Linux和所有的长期项目一样,随着时间的推移,旧的代码 会被丢弃和更换,但总体规模来说,Linux的内核在不断增强,以下是一些有趣的统计数字,它们可以告诉你Lin ......
(1)在tslib目录下有设置环境变量的文本文件:settsenv.sh,内容:
export T_ROOT=/system
export LD_LIBRARY_PATH=$T_ROOT/lib
export TSLIB_CONSOLEDEVICE=
export TSLIB_FBDEVICE=/dev/graphics/fb0
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
export TSLIB_CONFFILE=$T_R ......
2.1.2 是否通用
有些单片机厂家也给客户提供了大量的驱动程序,比如USB
HOST驱动程序,这可以让客户很容易就可以在它的上面编写程序读写U盘。但是客户写的这些程序,只能在这种芯片、这个驱动程序上使用;更换另一种芯片
后,即使芯片公司也提供了驱动程序,但是接口绝对不一样,客户又得重新编写应用程序。
基于操作 ......