Hello
I have some problem with sscanf, I tryed this code but it doesn't works
:
char* stringa = "18/2005"
char mese[3]; char anno[5];
int i_letture;
i_letture = sscanf(stringa, "%2s/%4s", &mese, &anno);
mese[2] = anno[4] = '\0';
The values ar random and I don't understand the motive
I tryed either this variant :
char* porka_vakka = strchr(stringa, '/');
*porka_vakka = '\0'; // but either ' ' e '\n'
i_letture = sscanf(stringa, "%s", &mese);
But neither this works...
Could anyone help me ?
Bye
- Atari
p.s. happy new year :)
I have some problem with sscanf, I tryed this code but it doesn't works
:
char* stringa = "18/2005"
char mese[3]; char anno[5];
int i_letture;
i_letture = sscanf(stringa, "%2s/%4s", &mese, &anno);
mese[2] = anno[4] = '\0';
The values ar random and I don't understand the motive
I tryed either this variant :
char* porka_vakka = strchr(stringa, '/');
*porka_vakka = '\0'; // but either ' ' e '\n'
i_letture = sscanf(stringa, "%s", &mese);
But neither this works...
Could anyone help me ?
Bye
- Atari
p.s. happy new year :)
Comment