#include <iostream>
#include <tchar.h>
int _tmain(int argc, TCHAR** argv)
{
std::cout << "sizeof(char) = " << sizeof(char) << std::endl;
std::cout << "sizeof(TCHAR) = " << sizeof(TCHAR) << std::endl;
std::cout << "sizeof(short) = " << sizeof(short) << std::endl;
std::cout << "sizeof(int) = " << sizeof(int) << std::endl;
std::cout << "sizeof(long) = " << sizeof(long) << std::endl;
std::cout << "sizeof(long long) = " << sizeof(long long) << std::endl;
std::cout << "sizeof(_int64) = " << sizeof(_int64) << std::endl;
return 0;
}
sizeof(char) = 1
sizeof(TCHAR) = 2
sizeof(short) = 2
sizeof(int) = 4
sizeof(long) = 4
sizeof(long long) = 8
sizeof(_int64) = 8
The output does not change even if I compile with x86 configuration. Why does int type always have 4-byte size? Shouldn't it allocate 8-bytes on a x64 system?