Bonjour,
j'ai un problème à comparer un tableau d'entier avec un chaine d'entier j'ai essayer d'utiliser la fonction atoi pendant le parcours mais ca sert a rien.
je construit un tableau depuis l'EEPROM puis je le compare avec la chaine (chz) en entrée.
la fonction retourne 1 si la chaine existe dans l'EEPROM. 0 sinon.
Merci bien,
j'ai un problème à comparer un tableau d'entier avec un chaine d'entier j'ai essayer d'utiliser la fonction atoi pendant le parcours mais ca sert a rien.
je construit un tableau depuis l'EEPROM puis je le compare avec la chaine (chz) en entrée.
la fonction retourne 1 si la chaine existe dans l'EEPROM. 0 sinon.
Merci bien,
C:
int existe (char chz[9]) {
int chh[12];char vv[9]; int v=0,ex = 1; char azerty;
unsigned int adres=(0x00);char az;unsigned int k;int f =0; int t;
while ((adres < 256) && (v==0))
{
f = 0;
// memset(chh, 0, sizeof(chh));
for( k=adres; k < (adres+(0x08)); k++) {
//Delay_ms(20);
//UART1_Write(';');
chh[f]=EEPROM_Read(k);
UART1_Write(chh[f]);
Delay_ms(20);
chh[f] = az;
f++;
}
UART1_Write('*');
f = 0; ex =1;
while( (f<8) && (ex==1))
{
if(chh[f] != atoi(&(chz[f])))
{ ex=0;
UART1_Write('e');
}
else {UART1_Write('v');}
f++;
}
v=(ex);
Delay_ms(20);
adres=(adres+(0x10));
}
Last edited by a moderator: