阅读背景:

C ++ select()不等待超时时间

来源:互联网 

I'm trying to use the select function to accept input but every 2 seconds do something else if the user hasn't entered anything. The code below is waiting two seconds the first time select() is reached but once it prints the first "timed out" message it rapidly keep printing out "timed out" without waiting for 2 seconds, basically entering an infinite loop. Anyone know what the problem is? Thanks for any help.I'm trying to use the select function to accept




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: