Not to long ago, someone told me that long
are not 64 bits on 64 bit machines and I should always use int
. This did not make sense to me. I have se
The easiest way to get to know it for your compiler/platform:
#include
int main() {
std::cout << sizeof(long)*8 << std::endl;
}
Themultiplication by 8 is to get bits from bytes.
When you need a particular size, it is often easiest to use one of the predefined types of a library. If that is undesirable, you can do what often happens with autoconf software and have the configuration system determine the right type for the needed size.