+ 2

why the second cin gets skipped?

just fed off with this cin keyword! #include <iostream> using namespace std; int main() { char nameM; char nameW; cout<<"Enter your name:\t"; cin>>nameM; cout<<"choose your partner\t:"; cin>>nameW; return 0; } output: enter your name: abcd choose your partner: (skipped)

10th Jul 2017, 12:35 PM
Rishabh Singh Rajput
Rishabh Singh Rajput - avatar
5 Answers
+ 16
In Sololearn code playground you have to give all the inputs at the same time.. So you will have to type name1 name2. //seperated by space OR name1 name2 //seperated by line
10th Jul 2017, 12:54 PM
Frost
Frost - avatar
+ 1
well i use code blocks and there too same problems persists. what is the reason behind its skipping? I am working on a program where both inputs cant be given at same time.This was just a little example to make the quesion more clear.
10th Jul 2017, 1:00 PM
Rishabh Singh Rajput
Rishabh Singh Rajput - avatar
+ 1
On SoloLearn's Code Playground the input function says "Split multiple inputs into separate lines"... Press enter for each cin
12th Jul 2017, 12:45 PM
@dri
@dri - avatar