I have this look up table :
char *table[ascii][morse];
where ascii is an int (representing an ascii letter) and morse is a string of length 4 + 1 ( to add the null). It is a look up table in a way where you ask for letter 0 = a and it should return the morse represntation of it.
if I have a ..-. (for example) in a file. and i want to add this to the look up table where index (ascii) = 0 how do i do that. Also, how do i print all the information in the look up table as : 0 > ..-. etc.
If you don't get the problem please tell me how i can explain more :)
The code i have right now to put chars in the look table is (and it is wrong) :
void ascii-morse (Lookuptable *table, char ascii, char *morsepassed) {
int index = ascii - 'a';
char copy[5];
strcpy(copy, morsepassed); // we need to copy the morse passed
table->table[index][5] = copy;
}
Please note that Lookuptable is a struct and that i have to have the same variables passed that way to my function