c++ - Representation of Long Integers -
possible duplicate:
what difference between int , long in c++?
#include <iostream> int main() { std::cout << sizeof(int) << std::endl; std::cout << sizeof(long int) << std::endl; }
output:
4 4
how possible? shouldn't long int
bigger in size int
?
the guarantees have are:
sizeof(int) <= sizeof(long) sizeof(int) * char_bits >= 16 sizeof(long) * char_bits >= 32 char_bits >= 8
all these conditions met with:
sizeof(int) == 4 sizeof(long) == 4
Comments
Post a Comment