Is there such a function or does one have to write it himself using getchar() and appending the chars into a buffer in a loop?
This is a discussion on is there a function that reads a certain number of chars on command line? within the C Programming forums, part of the General Programming Boards category; Is there such a function or does one have to write it himself using getchar() and appending the chars into ...
Is there such a function or does one have to write it himself using getchar() and appending the chars into a buffer in a loop?
You already asked this here. Also, did you read the FAQ, as Dave suggested in that thread? If you did, you would already know that command line input is in a buffer already, and you can do whatever you need to with it.
It could be just me, but I think that by "command line" he means stdin. In which case this FAQ entry holds the answer.