2013年8月28日

linux C语言getopt()函数的使用

摘要: getopt被用来解析命令行选项参数。#include 函数及参数介绍extern char *optarg; //选项的参数指针,如果选项字符串里的字母后接着冒号“:”,则表示还有相关的参数,全域变量optarg 即会指向此额外参数。如果getopt()找不到符合的参数则会印出错信息,并将全域变量optopt设为“?”字符,如果不希望getopt()印出错信息,则只要将全域变量opterr设为0即可。extern int optind, //下一次调用getopt的时,从optind存储的位置处重新开始检查选项。extern int opterr, //当opterr=0时,getopt不向 阅读全文

posted @ 2013-08-28 22:01 鹰之翔 阅读(1969) 评论(0) 推荐(0) 编辑

Unix 多进程

摘要: 深刻理解Linux进程间通信(IPC) 阅读全文

posted @ 2013-08-28 20:54 鹰之翔 阅读(155) 评论(0) 推荐(0) 编辑

导航