c++ - Proper use of the cin object? -


i using microsoft visual studio build simple windows console application exhibits simple i/o. when input more 1 word assigned string variable using cin object, program automatically displays of following questions immediately. can allow multiple word inputs?

for situations when need string allows spaces, use std::getline in place of >> operator:

std::string withspaces; getline(cin, withspaces); 

Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -