2016年3月18日

Understanding Unix/Linux Programming-用户程序:play_again3

摘要: 这里使用到了非阻塞输入: 怎么解释非阻塞输入与阻塞输入? 书上解释: 当调用getchar或者read从文件描述符读取输入时,这些调用通常会等待输入,这叫做阻塞输入(block input)。在play_again的例子中,对于getchar的调用使得程序一直等待用户的输入,知道用户输入一个字符。程 阅读全文

posted @ 2016-03-18 15:28 H.D 阅读(343) 评论(0) 推荐(0) 编辑

Understanding Unix/Linux Programming-用户程序:play_again2

摘要: 1 /* play_again1.c 2 * purpuse: ask if user wants another play 3 * better : instant response without echo 4 * returns: 0 -> yes , 1 -> no 5 */ 6 7 #include 8 #include 9 #include... 阅读全文

posted @ 2016-03-18 14:25 H.D 阅读(184) 评论(0) 推荐(0) 编辑

导航