On 6/19/06, Bastian Blank <[EMAIL PROTECTED]> wrote:
> Would it be safe to assume that a size_t can always be cast losslessly
> to an unsigned long (and then printed with %lu), or are there systems
> on which only an unsigned long long will do?

unsigned long is not sufficient.

OTOH, you could weigh up the chance that the number you're going to
output is greater than 2^32. If the chance is small, you cast it to
long and print using %lu. No chance of compiler errors, the display
will just look odd if you do try to print a larger number.
--
Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to