I need to know where I can find info on standard fixed-size C++ types, meaning stuff like __int32 and so on but some may be compiler-dependant. It must be standard C++.
I need to know where I can find info on standard fixed-size C++ types, meaning stuff like __int32 and so on but some may be compiler-dependant. It must be standard C++.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
There is nothing standard for exact-width integers in C++.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
The only guaranteed fixed-size type the C++ standard provides is sizeof(char) == 1. All the rest are compiler-dependent. On some compilers you will even find that sizeof(short)==sizeof(int)==sizeof(long)
Ouch. So what would my best way to work around this be then? Nested ifdef:s depending on compiler and system? Any info on this?
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.