Hello my friends, I'm Panos and this is my first post here in CBoard Forums![]()
Take a look to my C++ code:
No errors. Let's launch this:Code:#include <iostream> #include <string> int main() { std::cout << "What is your name? "; std::string name; std::cin >> name; std::cout << "Hello, " << name << std::endl << "And what is yours? "; std::cin >> name; std::cout << "Hello, " << name << " nice to meet you too!" << std::endl; return 0; }
Everything work perfect. Now let's launch it again giving two names (firstname & lastname) as input.
As you can see, it doesn't prompt me to insert the second name because it uses the my lastname (Georgiadis) and treat it like this way.
Is there any way to avoid this happening ?



LinkBack URL
About LinkBacks






