cin
just has a buffer behind it that gets filled up with input and then gets emptied as you use the extraction operator (>>
). When and how it gets filled up depends on the platform. In Unix-like systems, for example, the input terminal is in either canonical or non-canonical mode. In canonical mode, input is made available line by line. In non-canonical mode, it is available immediately. It's possible to change between these modes (check man termios
).
The actual size of the standard input buffer is implementation-defined.