gets shouldn't be used because it doesn't check to see how much you type. What it does do though is take the newline out of the input stream. It doesn't keep it, it just throws it out when it stops looking for input (that's how it decides to stop).

gets is basically this:
Code:
gets( string )
    x = 0
    while ( c = getchar ) != \n
        string[ x++ ] = c
    string[ x ] = \0
It doesn't care how much space you've set aside for your string. It just keeps going until it hits a newline.

getchar reads 1 character. So if you type 'c' and hit enter to send that, then your getchar takes the 'c', and the enter key sits there waiting for you to do something with it.


Quzah.