Sorry about the numerous posts, I'm just replying to various points
Anyways, it didn't look like anyone explained the problem. The \n is actually a carraige return (IE "Enter"). That keystroke, as I understand what joe_bruin is saying, gets passed along with the 'y', so you need to account for it.
Quote:
Originally posted by ntws01 I have no idea where you got that from, ther user does not at any point enter '\n' in fact there is no '\n' I used a forward slash because I knew that a backslash would be an escape charater. The user inputs either y or n but never '\n'.
As for the spelling mistake thats a minor problem.
BTW. I have had this problem before a number of times with GCC without a using 'cin << varname;' and that is why I'm think the problem might be the compiler itself |