bonsoir, j'ai un problème avec mon code au niveau de la concaténation de deux chaines de caractères avec la fonction strcat, voilà mon code
merci

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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# include <stdio.h>
# include <math.h>
#include <stdlib.h>
#include <unistd.h>
# include <string.h>
int main(int argc,char *argv[])
  {
    int i=0;
    char *text;
    int taille,t ;
    int j=0;
    int tab1[strlen(text)];
    int tab2[strlen(argv[1])];
    char s[7];
    int taille_m;
    char car[2]={' ',' '};
    char mot[2];
    char table[26];
    table[0]='A' ;
    table[1]='B' ;
    table[2]='C' ;
    table[3]='D' ;
    table[4]='E' ;
    table[5]='F' ;
    table[6]='G' ;
    table[7]='H' ;
    table[8]='I' ;
    table[9]='J' ;
    table[10]='K' ;
    table[11]='L' ;
    table[12]='M' ;
    table[13]='N' ;
    table[14]='O' ;
    table[15]='P' ;
    table[16]='Q' ;
    table[17]='R' ;
    table[18]='S' ;
    table[19]='T' ;
    table[20]='U' ;
    table[21]='V' ;
    table[22]='W' ;
    table[23]='X' ;
    table[24]='Y' ;
    table[25]='Z' ;
    printf("entrez le texte\n");
    scanf("%s",text);
    printf("%s",text);
    //s="bnsp";
    taille=strlen(text);
    printf("%d\n",taille);
    // strcpy(car," \0");
    //car[0]=" ";
    car[1]='\0';
    strcpy(mot,"aa");
    strcpy(s," ");
	printf( "bonjour");
// I retrieves the index of each character in the text that corresponds to the letter of the table
    for (i=0;i<=taille;i++)
     {
      while ((j<taille)&&(text[i]!=table[j]))
       {
	j++;
       }
	if (text[i]==table[j]) 
         {
	   tab1[i]=j;
	 }
	else
	 if (j>taille)
	 {
	   tab1[i]=100;
	 }
     }
// I retrieves the index of each character of the key that corresponds to the letter of the table
      t=strlen(argv[1]);
      printf("%d\n",t);
      j=0;
      for (i=0;i<=t;i++)
	{
      while ((j<t)&&(text[i]!=argv[1][i]))
       {
	j++;
       }
	if (argv[1][i]!=table[j]) 
         {
	   tab2[i]=j;
	 }
 
	}
//
 
 for (i=0;i<=taille;i++)
     {	 
	if (tab1[i]!=100)
	   {
	    if (i<t)
		{
		 if ((tab1[i]+tab2[i])<26)
		   {
 
		    strcpy(s,mot);
       		    car[0]=table[tab1[i]+tab2[i]];
		    printf("%c\n",car[0]);
		    strcat(s,car);
 		    printf("%s\n",s);
 
		   }
		 else
		   {
		    strcpy(s,mot);
                    car[0]=table[tab1[i]+tab2[i]-26];
 
		    strcat(s,car);
 		    printf("%s\n",s);		    
 
		   }
		}
	     else
		{
		  if ((tab1[i]+tab2[i-t])<26)
		   {
		    strcpy(s,mot);
		    car[0]=table[tab1[i]+tab2[i]];
 
		    strcat(s,s);
 		    printf("%s\n",car);
 
		   }
		  else
		   {
                    strcpy(s,mot);
		    car[0]=table[tab1[i]+tab2[i-t]-26];
 
		    strcat(s,car);
 		    printf("%s\n",s);
 
		   }
		}
	   }
	else
	  {
	   strcpy(s,mot);
	   car[0]=text[i];
 
	   strcat(s,car);
 
	  }
 
     }
printf("ciphertext\n");
printf("%s\n",s);		 
return 0;
}