While-loop program not stopping after input finishes

I have an assignment in which the user inputs a word and the program outputs how that word would be spelled using ICAO words. The problem I'm having is that I can't think of a way to structure the program so that it proceeds past my loop once it is finished processing my input. Currently, the program will just wait for more input.

Here's what I have now:
1
2
3
4
5
6
7
8
9
10
while (_alphabetWord != "nal")
	{
		_alphabetWord = alphabetWord(letter);
		cout << _alphabetWord;
		if (_alphabetWord == "nal")
		{
			break;
		}
		cin >> letter;
	}


I researched my problem on the Internet, but I don't think the code should be using methods like clear().
Also, please do not post code that I can copy and paste

Last edited on
Ok, I just talked to the instructor. For the purposes of this assignment, we are allowed to have the user input a character at the end of the inputted word. Which makes my job a lot easier.
Last edited on
Topic archived. No new replies allowed.