morse.c
const char* char_to_morse(char letter){
    const char* result_ptr = malloc(sizeof(char)*MAX_MORSE_LENGTH);
    bool result_set = false;
    for (int i = 0; i < NUM_OF_SYMBOLS; i++){
       	if (letter == SYMBOLS[i]){
	  result_ptr = MORSE[i];
          result_set = true;
		}
    }
    if (!result_set){
        result_ptr = MORSE_ERROR;
    }
    return result_ptr;
}
// This function returns a pointer to the morse code written above.
// The genuis of this function feels amazing because I've never used C before, but I see why
// ... it's used for performence!
//
// I do not copy ANY data. The pointer returned points to the above array!
This function returns a pointer to the morse code written above.
The genuis of this function feels amazing because I've never used C before, but I see why
it's used for performence!

I do not copy ANY data. The pointer returned points to the above array!
This function returns a pointer to the morse code written above . The genuis of this function feels amazing because I ' ve never used C before but I see why it ' s used for performence! I do not copy ANY data . The pointer returned points to the above array!
const char* char_to_morse(char letter){
    const char* result_ptr = malloc(sizeof(char)*MAX_MORSE_LENGTH);
    bool result_set = false;
    for (int i = 0; i < NUM_OF_SYMBOLS; i++){
       	if (letter == SYMBOLS[i]){
	  result_ptr = MORSE[i];
          result_set = true;
		}
    }
    if (!result_set){
        result_ptr = MORSE_ERROR;
    }
    return result_ptr;
}
const char * char_to_morse ( char letter ) { const char * result_ptr = malloc ( sizeof ( char ) * MAX_MORSE_LENGTH ) ; bool result_set = false ; for ( int i = 0 ; i < NUM_OF_SYMBOLS ; i ++ ) { if ( letter == SYMBOLS [ i ] ) { result_ptr = MORSE [ i ] ; result_set = true ; } } if ( ! result_set ) { result_ptr = MORSE_ERROR ; } return result_ptr ; }
This function returns a pointer to the morse code written above.
This function returns a pointer to the morse code written above .