易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux程序设计 终端


对终端进行读写
在编写程序时,我们往往需要从终端读入数据。一种情况是需要连续地读入用户键入的选择项,这往往出现在数据库程序中。程序员往往会使用
getchar
函数来读取数据,继而判断输入的数据是否有效,从而做出反应。其实如此做带有很大的风险,一个实例程序如下
#include <stdio.h>
 
char *menu[] = {
  
     
"a - add new record",
       
"d - delete record",
       
"q - quit",
       
NULL
};
 
int getchoice(char *choices[]){
       
int chosen = 0;
       
int selected;
       
char **option;
 
       
do {
               
option = choices;
             
  
while(*option){
                       
printf("%s\n", *option);
                       
option++;
               
}
               
selected = getchar();
               
option = choices;
               
while(*option){
                       


相关文档:

linux下串口编程


Linux 下串口编程入门
文档选项
<tr
valign="top"><td width="8"><img alt="" height="1" width="8"
src="//www.ibm.com/i/c.gif"/></td><td width="16"><img alt="" width="16"
heig ......

linux mysql php apache 配置安装

  我们把下载的三个软件包放到/var/local目录下(这是笔者个人的习惯),它们都是tar.gz包,可以用命令tar -xzpvf 包名,把它们在当前目录(/var/local/)中解开:
cd /var/local
tar -xzpvf mysql-4.0.15.tar.gz
tar -xzpvf php-4.3.3.tar.gz
tar -xzpvf httpd-2.0.47.tar.gz
  解包后可以开始进入正式安装。 ......

Linux内核解读入门

本文转自:http://topic.csdn.net/u/20100108/11/5422B656-B9CD-49F5-AD7A-8DA0AE9304AB.html 作者:longqiaojiang
针对好多Linux 爱好者对内核很有兴趣却无从下口,本文旨在介绍一种解读linux内核源码的入门方法,而不是解说linux复杂的内核机制; (参考资料来源:飞凌 http://www.witech.com.cn/)
一.核心源程 ......

20 Linux Server Hardening Security Tips

Securing your Linux server is important to protect your data, intellectual property, and time, from the hands of crackers (hackers). The system administrator is responsible for security Linux box. In this first part of a Linux server security series, I will provide 20 hardening tips for default inst ......

Linux必学的60个命令(转)

ifconfig
1.作用
ifconfig用于查看和更改网络接口的地址和参数,包括IP地址、网络掩码、广播地址,使用权限是超级用户。
2.格式
ifconfig -interface [options] address
3.主要参数
-interface:指定的网络接口名,如eth0和eth1。
up:激活指定的网络接口卡。
down:关闭指定的网络接口。
broadcast address:设置 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号