Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define Max_Size 80
char morsecode[45][8] = {
"a.-","b-...","c-.-.","d-..","e.","f..-.","g--.","h....","i..",
"j.---","k-.-","l.-..","m--","n-.","o---","p.--.","q--.-","r.-.",
"s...","t-","u..-","v...-","w.--","x-..-","y-.--","z--..","0-----",
"1.----","2..---","3...--","4....-","5.....","6-....","7--...",
"8---..","9----.","..-.-.-",",--..--",":---...","?..--..","'.----.",
"--....-","/-..-.","(-.--.-","\".-..-."};
char string1[] = { 'H','e','l','l','o' };
main() {
int length;
int x=3;
int n = 1;
int k;
char string2[80];
length = strlen( string1);
while( morsecode[x][n] != NULL ) {
string2[n-1] = morsecode[3][n];
n += 1;
}
printf("%s", string2);
getchar();}