I have to right a program that takes in a name and a number ex:(John 17 Jane 12) and then print them on the screen but i don't know how to make the one that is a string to stop taking in names.
here is what i have so far:
{
cout<< "please enter the name of your players and their number of goals.\n";
easiest way is to tell the user to enter something that you can test for such as "no more names" or "finished". Off the top of my head, I am not aware of any way to cause it to stop when entering strings because numbers can be turned into strings by the stream template. You could also ask for the number of players first, and then loop on that number.