Hello,

The function cin.get() was designed to extract unformatted data from stream. Though, the function gets() gets a string from stdin.

These two function have there instances, but none alike. I would recommend using cin.getline(). getline() gets a line from stream. It also extracts characters from the stream and stores them into successive locations in the array pointed by s. Learn more about this function by clicking the highlighted link above.


- Stack Overflow