标签:
参考以下链接自己补充实验:http://www.cppblog.com/mysileng/archive/2013/01/15/197284.aspx?opt=admin
int main(int argc,char *argv[]){
fd_set rfd;
char buf[3]={0};
FD_ZERO(&rfd);
while(1){
FD_SET(fileno(stdin),&rfd);
select(1,&rfd,0,0,0);
printf("standard input your data come in\n");
fgets(buf,3,stdin);
printf("buf=%s\n",buf);
}
}
标签:
原文地址:http://www.cnblogs.com/zengyiwen/p/5755216.html