I want to get a certain element based on what the user inputs in different lines. I am new to C++ programming so I am unsure of what route to take.
std::string siblings;
std::string names;
std::cout << "Please enter how many siblings you have: ";
std::cin >> siblings;
for (int x=0;x<siblings;x++){
std::cout << "Please enter your sibling(s) name: ";
std::cin >> names;
}
So if the user entered '3' siblings and typed in Mark, John, Susan, how do i get the name of the 2nd sibling - "John"? Or perhaps the first name entered, or last?
**Also, I wanted the question to just ask once and wait for the user to put in X amount of siblings based on what they put on different lines, then continue onto the program, but the question is repeatedly asking.