how to get input in structure memeber

Jan 28, 2013 at 4:54pm
Hi i wan to get input in structure memrber ty char array and i tried gets and cin.getline bt the complier do not stops here to get input it moves to the next line...same problem in class data member....
Last edited on Jan 28, 2013 at 4:55pm
Jan 28, 2013 at 5:00pm
Try posting some code, so we can see what you have down, so far. (:
Jan 28, 2013 at 5:01pm
Probably there is a newline in the input buffer after a previous item was input.
Clear the buffer before getline()
std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
or maybe
std::cin.ignore( 1000, '\n' );


Jan 29, 2013 at 3:47am
Thanks Chervil..
Topic archived. No new replies allowed.