I need to use printf() to print a uint16_t. This SO answer (How to print uint32_t and uint16_t variables value?) says I need to use inttypes.h.
However, I\'m working on
An obvious way is:
printf("%u\n", (unsigned int)x);
The unsigned int is guaranteed to be at least 16 bits, so this is not a lossy conversion.