Using the LibC APIs, how can my NLM...
Articles and Tips: qna
01 Feb 2003
Q.
Using the LibC APIs, how can my NLM print a 64 bit number in hex format? Can I use sprintf(temp, "%16x", bit64value) or is there a different format specifier?
Also, if I want to do math on 64-bit numbers, do I have to call functions to do them or can I just use "+, -, *, /"?
A.
You can use sprintf("%llx", sixty_four_bit_wide_number); or, of course, sprintf("%llX", sixty_four_bit_wide_number). C compilers generate code in support of all defined operators (+, -, *, /, ++, --, +=, >>, etc.).
* Originally published in Novell AppNotes
Disclaimer
The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.