Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: C++
Expertise: All
Jul 17, 2000

Tied iostream Objects

The standard streams cin and cout are automatically tied to each other. This means that whenever you're using both of them, C++ ensures that their operation is synchronized. In other words, if you have

 
cout << "enter your name: ";
cin >> name;  

C++ ensures that cout displays the message on the screen before cin will wait for input, even if you don't use an explicit flush operation or the endl manipulator. Therefore, whenever you display a message before accepting input, you can be sure that the output will appear before the system performs the input operation.

Danny Kalev
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap