If I have an integer variable I can use sscanf
as shown below by using the format specifier %d.
sscanf (line, "Value of integer: %d\n", &my_integer);
Where can I find format specifiers for uint8_t
, uint16_t
, uint32_t
and uint64_t
?
uint64_t has probably %lu.
%lu
forunsigned long
? That's often 32 bits. – MSaltersunsigned long
is 32 bits, whereas all UNIX and Linux 64 bitsunsigned long
are 64 bits. – Didier Trossetunsigned long
is NOT 64 bit on all 64 bit UNIX variants. It's 32 bits on 64 bit solaris using gcc. I once had a painful experience learning that it's 64bits on linux. – camelccc