Okay, I feel really stupid, but I cannot seem to get this down pat. Last assigment I turned in incomplete because of the same issue, but for whatever reason, I cannot seem to figure out how to read one character at at time and then output the conversion to a string.

This is what this program is supposed to do. The user is supposed to enter a word and the program is supposed to send out the Phonetic. EG: Type in Rose and you should get: Romeo Oscar Sierra Echo as the output. But everytime I run this program, I get 'invalid data' outputting endlessly.

Here is my code. Can you guys help?

Code:




#include <iostream>
#include <string>
#include <cctype>

using namespace std;

void getPhonetic(char&, string&, string&);
int main()
{
char readChar;
string insertString;
string outputString;

getPhonetic(readChar, insertString, outputString);

cin.ignore();
cin.get();
return 1;
}


void getPhonetic(char& readChar, string& insertString, string& outputString)
{

cout << "Please type in a word to convert: \n";
cin >> insertString;

cin.get(readChar);
readChar = tolower(readChar);
while (readChar != '/n')
 




	 switch(readChar)
{

case 'a': cout << "Alpha";
		  break;
case 'b': cout << "Bravo";
		  break;
case 'c': cout << "Charlie";
		  break;
case 'd': cout << "Delta";
		  break;
case 'e': cout << "Echo";
		  break;
case 'f': cout << "Foxtrot";
		  break;
case 'g': cout << "Golf";
		  break;
case 'h': cout << "Hotel";
		  break;
case 'i': cout << "India";
		  break;
case 'j': cout << "Juliet";
		  break;
case 'k': cout << "Kilo";
		  break;
case 'l': cout << "Lima";
		  break;
case 'm': cout << "Mike";
		  break;
case 'n': cout << "November";
		  break;
case 'o': cout << "Oscar";
		  break;
case 'p': cout << "Papa";
		  break;
case 'q': cout << "Quebec";
		  break;
case 'r': cout << "Romeo";
		  break;
case 's': cout << "Sierra";
		  break;
case 't': cout << "Tango";
		  break;
case 'u': cout << "Uniform";
		  break;
case 'v': cout << "Victor";
		  break;
case 'w': cout << "Whiskey";
		  break;
case 'x': cout << "X=ray";
		  break;
case 'y': cout << "Yankee";
		  break;
case 'z': cout << "Zulu";
		  break;
default:  cout << "Invalid symbol";
		  break;
}
outputString = outputString + " " + readChar;
readChar++;
cout << outputString;
}