Browse - Programming Tips - How can I printf a DWORD?

Date: 2015dec8
Updated: 2017feb11
Language: C/C++
OS: Windows
Keywords: print, WORD

Q.  How can I printf a DWORD?

A.

// In Hex printf("%08x\n", dwInfo); // Will be 8 hex digits printf("0x%08x\n", dwInfo); // You can add "0x" in front if you want
// In Decimal printf("%lu\n", dwInfo); // Long and unsigned