Salut !

J'ai écris un programme qui marche parfaitement, j'ai un tout petit problème dans la fonction afficher(), j'essaye d'afficher un tableau avec des printf(c-a-d le dessiner) mais sans qu'il y aura un décalage quand je rajoute des valeurs, je sais pas trop comment faire, veuillez m'aider svp, 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
42
43
44
45
46
void afficher()
{int i;
printf("/***************Table des symboles IDF*************/\n");
 
printf("	 _________________________________________________________ \n");
		printf("	|     TABLE DES SYMBOLES                    |\n");
		printf("	                                            |\n"); 
		printf("	|   name      |  type         |    val             |\n"); 
		printf("	 -------------------------------------------- \n");
for(i=0;i<1000;i++)
if(tab[i].state==1)
{
               printf("              %s             %s",tab[i].name,tab[i].type);
 
if((strcmp(tab[i].type,"reel")==0)||(strcmp(tab[i].type,"entier")==0))
               printf("                                             %f\n",tab[i].val);
else
printf("\n");
}
printf("\n/***************Table des symboles mots clés*************/\n");
 
printf("	 ___________________________________________________________ \n");
		printf("	|     TABLE DES SYMBOLES                    |\n");
		printf("	                                            |\n"); 
		printf("	|   name           |  type                  |\n"); 
		printf("	 ------------------------------------------- \n");
for(i=0;i<40;i++)
if(tabm[i].state==1)
{
                printf("        |     %s            |           %s          | \n  ",tabm[i].name,tabm[i].type);
 
}
printf("\n/***************Table des symboles séparateurs*************/\n");
 
printf("	 _________________________________________________________ \n");
		printf("	|     TABLE DES SYMBOLES                    |\n");
		printf("	                                            |\n"); 
		printf("	|   name      |  type                       |\n"); 
		printf("	 ------------------------------------ \n");
for(i=0;i<40;i++)
if(tabs[i].state==1)
{
                 printf("              %s            %s \n",tabs[i].name,tabs[i].type);
 
}
}