On 5/22/06, Cory Nelson <[EMAIL PROTECTED]> wrote:
The warning is likely because size_t can be 64bit and "int" is always 32bit. Either way, it should be casted.
Not really, size_t can be 64 or any other size in bits and same with int's. If I'm not mistaken, size_t is 64 bits on Microsoft 64 bits compiler and int is 32 bits on the same compiler, but gcc 64 bits version have both as 64 bits (at least for x86-64). I'll omit the 16 bit cases of some years ago. I'm not fully sure about this as I never had to do any programming for 64 bits, yet, so correct me if I'm wrong. If you really want to be sure of the size of types, use the C99 <stdint.h> header and use things like int32_t, uint32_t, int64_t and uint64_t (and all other types defined there). Best regards, ~Nuno Lucas