What does the C++ standard say about the size of int, long, and long long types?
Hi everyone! I just started learning C++ and ran into some confusion. I know that on different compilers and platforms, the sizes of integer types can vary. I wrote a simple code to check this on my machine (Windows, MinGW):\n\n```cpp\n#include \nusing namespace std;\n\nint main() {\n cout << "Size of int: " << sizeof(int) << " bytes" << endl;\n cout << "Size of long: " << sizeof(long) << " bytes" << endl;\n cout << "Size of long long: " << sizeof(long long) << " bytes" << endl;\n return 0;\n}\n```\n\nOn my computer, I got: int = 4 bytes, long = 4 bytes, long long = 8 bytes. But I read online that on Linux x86_64, long can be 8 bytes. My friend said that on old 16-bit systems, int was 2 bytes.\n\nI'm interested in: what does the