std::string getName( const std::string strDefault )
std::cout << "Enter your name [default='" << strDefault << "']: ";
getline( std::cin, strName );
if ( false != strName.empty() )
strName = strDefault;
int main(int argc, char* argv)
std::string strName = getName( "John Doe" );
std::cout << "Entered name: '" << strName << "'" << std::endl;
Open in new window
The revolutionary project management tool is here! Plan visually with a single glance and make sure your projects get done.
Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.