The purpose of this program is to translate a user inputed sentence into morseCode. It seems like everything is right to me, but I'm simply not getting output! What am I doing wrong, or what should I add/change? Any help is greatly appreciated.
Since you are comparing the ith character in the input string to the ith character in the alphabet array, it seems like you would only get matches (and output) when the input string resembles the alphabet string. What do you get with an input of ABCXXFG?
You code use another loop to scan through the alphabet array looking for a match. If a match is found, you would know the offset where it was found in the alphabet array, and could use that to look-up the corresponding value in the code array.
Update: As Ulf suggested, a Map would be even better if that is an option for you.