Implement a function char* readLine(); which returns single lines from a buffer. To read the buffer, you can makes use of a function int read(char* buf, int len) which fills buf with upto len chars and returns the actual number of chars filled in. Function readLine can be called as many times as desired. If there is no valid data or newline terminated string available, it must block. In order to block, it can use read function which in turn will block when it doesn't have anything to fill the buf.
Anónimo
are you stupid?