I am creating a simple command-line program and want the user to hit “enter” to begin the program. I am doing some input validation, but for some reason my while loop keeps getting caught in an infinite loop.
current program
I know it has something to do with the cin buffer. I think it’s stuck in being a bad bit, so I tried using clear() and ignore(), but it appears that didn’t resolve the issue.