I had the same issues with one of my codes. I am no c++ expert so I cannot explain definite reasons but when I used getline() following the use of cin >> variable the getline was skipped, I found that the problem was fixed if I used all getline() functions in place of regular cin >> variable functions. I cannot explain why it works but I would guess it has something to do with the way the input is buffered. May sound like nonsense but thats what I would guess with the knowledge I have atm. Anyway, try replacing cin>>variable with getline() if not, I don't know what to tell you. Hope this helps. I used getline(cin, [string to store to]) then used sstream([string stored to]) >> variable in my codes to fix it. Hope that helps.
Last edited by c++noobie; Feb 11th, 2008 at 2:03 am.
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
Offline 71 posts
since Feb 2008