LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 711|回复: 3

How to get keyboard input from C in Linux

[复制链接]
发表于 2003-8-2 15:51:36 | 显示全部楼层 |阅读模式
I am develop a "counsol application" (command line environment).
I want to know how to get keyboard input from a C program.
(this means the user interactes with the program by typing into
the command line.)

This program is related to creating teaching material for high
school programing class for China. I want to avoid using GUI IDE.
I plan to use the open source IDE Rhide. or just use gcc.
发表于 2003-8-2 17:49:02 | 显示全部楼层
not scanf,gets,getchar???
 楼主| 发表于 2003-8-3 01:14:31 | 显示全部楼层

getchar(), read(), getc(stdin), fscanf()

Sorry, I fogot many things I learned years ago.

Actually, I can use getchar(), read(), getc(stdin), or maybe fscanf(stdin, ...).

The cin and cout are C++ stuff.
发表于 2003-8-3 01:52:36 | 显示全部楼层
You can search them in C library.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表