How to input two strings simultaneously one after other?
Please help me in my following code to Enter string number string in the same order but only first two (string and number) input get store and third string didn't get stored the other variable
Please helo me in flushing the buffer because I forgot how to flush the buffer???
cin>>na; reads until a space.
getline method reads entire line.
in your code:
cin>>na; //after reading into na, everything next input read by the next getline method until next line...
So if you press enter, it goes to 'other' array..
To store next line input to store in other and to consume enter, use getchar() method..