Issue with program.

*topic solved.
Last edited on
After cin >> again the \n remains in the input buffer and getline will only read the \n and terminate.
One way to fix this is to use cin.ignore(); after cin >> again
Thank your for your help! By adding cin.ignore(); the program now ignores the newline character and the loop works correctly now.
Don't delete your post after being helped. Leave it as a reference for others that might run into your same problem.
Topic archived. No new replies allowed.