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版本2.6.27更新后,人们发现,这一内核的源代码数量已经超过了1000万行.
当然,这些行数仅仅是计算机统计出来的行数,包括空白行,为了代码的可读性增加的注释等,当然Linux和所有的长期项目一样,随着时间的推移,旧的代码 会被丢弃和更换,但总体规模来说,Linux的内核在不断增强,以下是一些有趣的统计数字,它们可以告诉你Lin ......
转载自 http://www.builder.com.cn/2007/1015/556732.shtml
Linux环境下USB的原理、驱动和配置
开发者在线 Builder.com.cn
更新时间:2007-10-15
作者:北京中科红旗软件技术有限公司 嵌入式工程师 梁国军
来源:CSDN
本文关键词: Linux
USB
作者为北京中科红旗软件技术有限公司 嵌入式工程师 ......
现在嵌入式也玩多核了。
利用./mpstat -P ALL 1 100 可以来查看cpu的使用情况。
这个是转的一个例子:
在多CPU的趋势越来越大了. 有时候为了更好地操作机器, 需要将某个进程绑定到具体的CPU上去. 下面给出了一个进程绑定到具体的CPU上去的一个例子.
view plaincopy to clipboardprint?
···&midd ......
作者:韦东山,
华清远见嵌入式学院
讲师。
随着嵌
入式行业硬件平台的性能增强,项目需求和功能日益复杂,ARM公司推出的
CORTEX-M3,更是让以往做单片机的工程师在芯片和技术选型面临两难选择,本专题将从芯片价格、整个系统的硬件软件设计及维护的成本等各个方面给您
提供一个参考, 并从技术角度分析单片机和带操 ......
2.1.2 是否通用
有些单片机厂家也给客户提供了大量的驱动程序,比如USB
HOST驱动程序,这可以让客户很容易就可以在它的上面编写程序读写U盘。但是客户写的这些程序,只能在这种芯片、这个驱动程序上使用;更换另一种芯片
后,即使芯片公司也提供了驱动程序,但是接口绝对不一样,客户又得重新编写应用程序。
基于操作 ......