#include <unistd.h>
int getopt(int argc, char * const argv[], const char * optstring);
#include <stdio.h>
#include <unistd.h>
int main(int argc, char **argv)
{
int ch;
opterr = 0;
while((ch = getopt(argc, argv, "a:bcde")) != -1)
switch(ch)
{
case 'a':
printf("option a:'%s'\n", optarg); break;
case 'b':
printf("option b :b\n"); break;
default:
printf("other option :%c\n", ch);
}
printf("optopt +%c\n", optopt);
}
$. /getopt -b option b:b $. /getopt -c other option:c $. /getopt -a other option :? $. /getopt -a12345 option a:'12345'
int select(int n, fd_set * readfds, fd_set * writefds, fd_set * exceptfds, struct timeval * timeout);
struct timeval
{
time_t tv_sec;
time_t tv_usec;
};
fs_set readset;
FD_ZERO(&readset);
FD_SET(fd, &readset);
select(fd+1, &readset, NULL, NULL, NULL);
if(FD_ISSET(fd, readset){...}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有