cin.ignore getline and other things

Me and a classmate are working on a project currently and are having problems.
He uses a single cin designation to write two inputs, separated by a space, to write to two variables. We have tried using cin.ignore but to no avail; it asks for one of the two line inputs, accepts it, then skips the second one. It prints it out as instructed.
Problem, in simple is, it takes input from one line (a number and a price), assigns to variable, prints prompt for second input, then prints result, skipping second input
I solved it one way: separate lines for input. He wants one number.
we used one line input, two cin inputs(assign, cin.ignore, twice). He wants to be stubborn and ask for the number and price at once
Thanks.
std::cin >> by default will only get the first "word" out of the text. If you want to get them both in the same line you can stack the >>:

 
std::cin >> var1 >> var2;
Topic archived. No new replies allowed.