Infinite While Loop.

EDIT: Solved.

Hey guys,
So im currently attempting to create a while loop that if a "space" is entered, then the input will stop and it restarts the loop. this is what I have but it enters a continuous loop that will not stop.
Any suggestions would help.

1
2
3
4
5
6
7
8
9
10
11
  while(ch != 13)
			{//character 13 is enter - carriage return
				if (ch == ' ')
					cout << "Incorrect";
				else{
					pass += ch;
					cin.putback(ch);
					cout << '*';
					ch = _getch();
				}
			}  
Last edited on
Never mind, I feel like an idiot. All i was doing was missing the recall method in my If Statement. Thanks anyway for the help and sorry for wasting your time if read.
Topic archived. No new replies allowed.