Question of cin object

Im just wondering about something, because im used to actionscript, c++ is quite different to it.

When i put:

cout <<"hi"<< endl;
cout <<"bye"<< endl;

Those words are shown together.

but if i put cin >> name; inbetween them it stops bye from being shown until i type something in and press enter.

Is this just a rule of c++, the cin object stops the following code from running until the person has typed something in?

Sort of. istream operator >> waits until there is some data available before returning it. One thing you're wrong about is this is not a rule of c++ this is just how cin (and, generally, console) works. cin is not a part of the language. You could, for example, use WinAPI or ncurses to do stuff with console.
thanks :)
Topic archived. No new replies allowed.