the letters of the alphabet A through Z can be represented in Morse code. Each letter is represented by a combination of up to four dots (.) and/or dashes (-). For example
A=".- ", B="-...", C="-.-.", D="-.. " through Z="--.."
In these groups of characters spaces have been deliberately introduced to fill the code up to the maximum of four characters. However the space does not represent part of the code. The codes for the letters A through Z can be represented as the following character string.
Code:char *MorseData = ".- -...-.-.-.. . ..-.--. ...... .----.- .-..-- " "-. --- .--.--.-.-. ... - ..- ...-.-- -..--.----.."
write a program to input a message string and using the character string MorseData, convert the message into Morse code and display the result.
thats the question from the book, what i cant work out is how to link the string MorseData to the letters A to Z, i thought about using switch case with strcmp but would take a hell of lot of code.
Also i seem to get thrown by questions like this, is it my in-experience with 'C', is one born with natural "logical" talents, or is a case of doing again and again till it sinks in.
by the way i think this forum is wicked and find it much more helpfull than any resource at uni, when i got proficient i hope to give some thing back