scanf kann nicht Scannen, in uint8_t

Wenn ich versuche, mit scanf mit uint8_t bekomme ich verrückte Ergebnisse.
Mit int, ich bekomme die erwartete Ausgabe "08 - 15".
Mit uint8_t, bekomme ich "00 - 15".

const char *foo = "0815";
uint8_t d1, d2; //output: 00 - 15 (!!!)
//int d1, d2;         //output: 08 - 15
sscanf(foo, "%2d %2d", &d1, &d2);
printf("%02d - %02d\n", d1, d2);

Bin ich mit GCC.

InformationsquelleAutor Dill | 2014-05-19
Schreibe einen Kommentar