So, One of my lab assignments is to take a word and output how that word would be spelled using International Civil Aviation Organization Alphabet words. Now, I think I have somewhat of an idea as to how to go about doing this:
First, break the string up into 1-character substrings
Second, compare each substring against a letter. Now, I'm not sure how to do this part, because these are strings and switch statements need "char"s or "int"s.
Then, iterate through each letter in your word. Print out the string in the n'th location of the string array (where 'n' is the position that matches the current letter).
1 2 3 4 5 6 7
std::string word = "abc";
for (int i = 0; i < word.size(); ++i) {
std::cout << nato[word[i] - 'a'] << std::endl;
}
This code assumes that the word has no numbers, uppercase letters or other special characters.