I am new to C++ programming and am trying to create a program that asks the user questions. For example,
std::string siblings;
std::cout << "How many siblings do you have?"; //Let's say the user inputs 2
std::cin >> siblings;
for (int x=0;x<n;x++){
std::string current;
std::string sibling_info;
std::cout << "What is the name + age of sibling #" << (x+1) << ": ";
std::cin >> current;
sibling_info.emplace_back(current);
I want the user to input "John 13" with a space in between, but whenever I put a space the program does not run the way I want it to and doesn't ask the user twice.