View Single Post
Old 2009-10-01, 00:36   #4
rogue's Avatar
Apr 2003
Between here and the

25×193 Posts

Originally Posted by R. Gerbicz View Post
"long long unsigned int" is in wrong order. I think you want:
"unsigned long long int".

And if %I64u doesn't works then try the other format: %llu. One of them should be good.
"long long int" is redundant. "long long" is sufficient. For portable code, %llu should be used.

Also if you are using MinGW, there is probably a header called stdint.h. This has a predefined uint64_t variable type.

Finally, I try to avoid using "int" because some compilers treat an int as a 16 bit value (aka short int), even though the CPU and OS are 32-bit. You could use long, which will be 32 bits or 64 bits (depending upon the compiler, OS, and compiler options). I don't know if any compiler defines a long as 16 bits. I always use stdint.h to guarantee portability. Unfortunately M$ doesn't have such a header in Visual Studio, but you can #typedef those datatypes using WORD and DWORD appropriately to ensure portability.

Last fiddled with by rogue on 2009-10-01 at 00:50
rogue is offline   Reply With Quote