Problème chaine de caractère sous vista
Bonjour,
Depuis que je suis passé sur sur ce superbe vista, j'ai beaucoup de problème pour gérer les chaines de caractères. Je code avec visual studio 2005.
Code:
1 2 3 4 5 6
|
char *temp_texte;
unsigned char Code_Constructeur[8];
strcpy(temp_texte,"123456789ABCDEF1");
sscanf(temp_texte, "%x%x%x%x%x%x%x%x", &Code_Constructeur[0],&Code_Constructeur[1],&Code_Constructeur[2],&Code_Constructeur[3]
,&Code_Constructeur[4],&Code_Constructeur[5],&Code_Constructeur[6],&Code_Constructeur[7]); |
Je devrai obtenir :
Code:
1 2 3 4 5 6 7 8 9
|
Code_Constructeur[0]=0x12
Code_Constructeur[1]=0x34
Code_Constructeur[2]=0x56
Code_Constructeur[3]=0x78
Code_Constructeur[4]=0x9A
Code_Constructeur[5]=0xBC
Code_Constructeur[6]=0xDE
Code_Constructeur[7]=0xF1 |
et j'obtient :
Code:
1 2 3 4 5 6 7 8 9
|
Code_Constructeur[0]=0xbc
Code_Constructeur[1]=0xfc
Code_Constructeur[2]=0x12
Code_Constructeur[3]=0x00
Code_Constructeur[4]=0xf1
Code_Constructeur[5]=0xde
Code_Constructeur[6]=0xbc
Code_Constructeur[7]=0x9a |
Des octets bizarre sont stocké au début de la chaine.
Une idée?
pense a mettre la balise code, Merci Farscape