»
(03) Basic Data Types in C++14
(18) C++14 smart pointer and reference counter*
(19) C++14 pthread*
(20) C++14 synchronized locker--mutex*
(24) C++ time and sleep*
(25) C++ High Precision Computation*
(27) C++14 std::string*
(31) Advanced Level C++ Tech*
Year 2024, C++ compiler:
char 1byte
short 2bytes
int 4bytes
long not fixed, 4bytes or 8bytes, 8bytes in windows x64
long long 8bytes
float 4bytes
double not fixed, 4bytes or 8bytes, 8bytes in windows x64
long double 8bytes
In 2024, the boundery on the market of CPU, is between 32bits and 64bits.
So, the char, short, int has been confirmed be 1byte, 2bytes, 4bytes.
Have you found the rule?
During the alternation of 16bits and 32bits, the not fixed data type is int. So, there are short int, int and long int.
During the alternation of 32bits and 64bits, the not fixed data type is long, So, there are long and long long.
I'm so old and I'm so young that I'm sure I will need to be treated well.