I just started learning C++ and implemented a simple program which will produce the correct size of various data types (based on the bit width of the data type). For example...
Data Types Used
- char: 1 byte
- int: 4 bytes
- short int: 2 bytes
- long int: 4 bytes
- float: 4 bytes
- double: 8 bytes
- wchar_t: 2 or 4 bytes