This may be a total beginner\'s question, but I have yet to find an answer that works for me.
Currently, I\'m writing a program for a class that takes in a user\'s input
By default, cin
reads from the input discarding any spaces. So, all you have to do is to use a do while
loop to read the input more than one time:
do {
cout<<"Enter a number, or numbers separated by a space, between 1 and 1000."<> num;
// reset your variables
// your function stuff (calculations)
}
while (true); // or some condition