Sprintf convert fail to convert 4bytes into hex
hello,
does sprintf can convert hex bigger 2 bytes ?
example:
the output be: 0000cdef
it converts 2 right bytes,
am missing something?
thanks
does sprintf can convert hex bigger 2 bytes ?
example:
code: [select]
char str[20];
sprintf(str, "hex: %08x", 0xaaabcdef);
serial.println(str);
the output be: 0000cdef
it converts 2 right bytes,
am missing something?
thanks
am missing something?when life gives lemons, make lemonade!
when life gives "long" variables, make long formatting!
code: [select]
char str[20];
sprintf(str, "hex: %08lx", 0xaaabcdef);
serial.println(str);
Arduino Forum > Using Arduino > Programming Questions > Sprintf convert fail to convert 4bytes into hex
arduino
Comments
Post a Comment