I have a problem where I need to take a string input by the user and convert it into a series of words used to spell it out phonetically. For example:
Enter sting: program
Phonetic version is: Papa Romeo Oscar Golf Romeo Alpha Mike.
I can do the converting process, but I have no idea how to take the string and read it character by character. Keep in mind I'm in my first C++ class ever and don't know much, so try and keep it simple.
I don't think I've learned about array's yet, I really don't know what that is.
I found a function mentioned in my book called the "at" function, could I do something like this:
1 2 3 4 5 6
while (currentChar != '\n')
{
currentChar = userInput.at(pos);
CharConvert(currentChar); //CharConvert is the function that will handle the conversion
pos++;
}
Where userInput is the string, and pos is the position char.