sizeof
Here is list of types in C++ with sizes in Bytes (unfortunately C++ doesn't define all of them, so they vary among compilers).
| Compiler | Visual Studio | gcc | Clang | ||
|---|---|---|---|---|---|
| Type / Platform | 32bit | 64Bit | 64Bit | 32bit | 64Bit |
| char | 1 | 1 | 1 | 1 | 1 |
| short | 2 | 2 | 2 | 2 | 2 |
| int | 4 | 4 | 4 | 4 | 4 |
| long | 4 | 4 | 8 | 4 | 4 |
| long long | 8 | 8 | 8 | 8 | 8 |
| float | 4 | 4 | 4 | 4 | 4 |
| double | 8 | 8 | 8 | 8 | 8 |
| void* | 4 | 8 | 8 | 4 | 8 |