Bonjour ,
par defaut mon tableau de caractere contient deja du texte. Comment faire pour que ce ne soit plus le cas ?
En effet cat contient cat=° 4 a son premier printf Comment s'en debarasser ?
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
 
char* convertByteToBinary(char *textByte,char textBinary[128])
 
{
	char cat[128];
	char blb[9];
	//convert Byte To binaries
	printf("cat=%s\n",cat);
	while(*textByte)
	{
	//convert char en binaire
	type2bin(*textByte,blb);
     //printf("blb=%s\n",blb);
	strcat(cat,blb);
 printf("cat=%s\n",cat);
	textByte++;
	}
		//printf("cat=%s\n",cat);
	strncpy(textBinary,cat,128);
	//printf("cat=%s\n",textBinary);
}
En faisant precedemment des tests