Yes its homework
We were suppose to have char 2D array holding character with size limit of 255 char char string[100][255];
Program neede: change the input morse code by a user to alphabet/English letter (Capital Letters)
Sample Input
2
.... . .-.. .-.. --- / .-- --- .-. .-.. -..
.--- --- -.- .
Sample OutPut
Case#1:
HELLO WORLD
Case#2:
JOKE
My only idea is to have the first characters of a word that is inputed by the user.. to be.. checked if its '.' or '-' then scrupulously and manually assigning.. the nested if(string[i][c]=='.')
and the last if on each nested would be if(string[i][c]==' ')
then that prints out the letter "E" example
if(string[i][c]=='.') {
isspace(string[i][c+1])
printf("E");
}
Now my question is.. is there any easier way for this problem? where i don't have to type the same '-' and '.' if statement.. and stuff? and have my mind explode? because I lose track of corresponding the next char with if or case statements?