C++ Programming help!

User Generated

penmlzvff2014

Other

Description

Rewrite the program example given. This time, ask the user to enter his first and last names, separated by a space, on one line (i.e., use one “ cin >>” operation to read both the first and last name in one pass). Does a problem occur? If so, describe it in complete sentences. Then try and find a temporary “workaround” to the problem, by any means possible.

//===================================================================
// print_string.cpp By Frank Luna
//===================================================================

#include 
#include

int main( )

std::string firstName = "";

std::cout << "Enter your first name and press Enter: ";

std::cin >> firstName;

std::cout << std::endl;

std::cout << "Hello, " << firstName << std::endl << std::endl;
}


User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer


Anonymous
This is great! Exactly what I wanted.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Similar Content

Related Tags