using fgets as non-blocking function c++

前端 未结 5 633
情书的邮戳
情书的邮戳 2020-12-12 01:23

I\'m writing a program that reads in a loop from the stdin, using the function fgets, as follows:

while(fgets(buffer2, BUFFERSIZE , stdin) != NULL){
  //So         


        
5条回答
  •  庸人自扰
    2020-12-12 02:14

    On Linux, you can specify the end of input by pressing ctrl-d, and of-course you can do this using separate thread.

提交回复
热议问题