C++ examples for Data Type:Introduction
Determining Storage Size using operator sizeof() for the int, char, and bool data types.
#include <iostream> using namespace std; int main()/*from ww w. ja v a 2 s. c o m*/ { cout << "\nData Type Bytes" << "\n--------- -----" << "\nint " << sizeof(int) << "\nchar " << sizeof(char) << "\nbool " << sizeof(bool) << '\n'; return 0; }