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常用命令参考
1. diff
用于文件比较。一般file1是原文件,file2是新(修改过)的文件。
紧凑模式:diff -u file1 file2
diff -u file1 file2
--- file1 2010-03-06 02:11:43.000000000 +0000
+++ file2 2010-04-14 10:06:45.000000000 +0000
@@ -21,11 +21,9 @@
eeeeee
ffffff
2222 ......
cat awk '{print}'
cat -s awk '{blank = NF == 0 ? ++blan ......
转载自 http://www.builder.com.cn/2007/1015/556732.shtml
Linux环境下USB的原理、驱动和配置
开发者在线 Builder.com.cn
更新时间:2007-10-15
作者:北京中科红旗软件技术有限公司 嵌入式工程师 梁国军
来源:CSDN
本文关键词: Linux
USB
作者为北京中科红旗软件技术有限公司 嵌入式工程师 ......
Linux软件包,常见的格式包括有rpm,deb,tar,gz,tgz,zip,bz2等等。几乎每个linux软件都会提供tar的格式的软件包,因为这种格式的软件包任何版本的linux都支持,所以大家至少要了解tar和rpm的使用方法。至于deb可用alien工具转换成tgz或rpm方式。bz2可用bunzip2解包即可。
一、RPM文件的安装
RPM 是RedHat Package ......
我这里说的ioctl函数是在驱动程式里的,因为我不知道更有没有别的场合用到了ioctl,
所以就规定了我们讨论的范围。为什么要写篇文章呢,是因为我前一阵子被ioctl给搞混
了,这几天才弄明白他,于是在这里清理一下头脑。
  ......