j'ai un programme qui traduit du texte en code morse je voudrai cependant ecrire une structure "code morse" contenan "car[]" et "table[]"
Cependant je ne connait pas les structures j'ai besoin d'aide
voici mon code

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdio.h>
#include <stdlib.h>
 
#include <string.h>
 
 
 
int main(int argc, char *argv[])
{
 char Car[38]={'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 * table[38]  =  {".-","-...","-.-.","-..",".","..-.","--.","....","..",
                     ".---","-.-",".-..","--","-.","---",".--.",
                     "--.-",".-.","...",
                     "-","..-","...-",".---","-..-","-.--","--..","-----",
                     "----","..---","...--",
                     "....-",".....","-....","--...","---.."," ----.",".-.-.-"," "};
 
char  p[250];
unsigned short i;
unsigned short j;
unsigned short k;
 
printf ("sasir la phrase a trahuir en morse:");
printf ("\n");
gets(p);
i=strlen(p);
 
for(j=0;j<i;j++){
 
 for (k=0;k<38;k++){
  if (p[j]==Car[k]){
printf (table[k]);
  }
 }
 
}
 
}
Puis-je garder mes boucles si j'utilise une structure?
merci