How do I fill an 80-character buffer with characters as they are being entered or until the carriage return key is pressed, or the buffer is full, whichever occurs first.
I've looked into a lot of different ways, but enter has to be pressed then the input char* gets cut off at 80..
Thanks.
If you really want the characters "as they are entered", you cannot use C io. You have to do it the unix way. (or windows way)
Once you have
buffer
as a string, make sure you digest the rest of the line of input to get the input stream ready for its next use.This can be done by the following code (taken from the
scanf
section of this document):