Hey working on a little program here and when i enter a full name like BOB JONES it comes up with name BOB rank JONES and if i enter just BOB for a name and Master Sgt for rank it just has Master. How do I fix this? So there can be spaces?
[code]#include #include #include
std::cout << "Enter name: ";
std::cin >> name;
std::cout << "Enter Rank: ";
std::cin >> rank;
std::cout << "Your name is: " << name << std::endl;
std::cout << "Rank of " << name << " is " << rank << std::endl;