If you are curious about how much memory your C++ implementation
allocates for the various data types, you can compile and execute the
following program, which uses the
sizeof
operator to determine data-type size:
#includemain ( ) { cout << "Data Type Bytes" << endl << "char " << sizeof(char) << endl << "short " << sizeof(short) << endl << "int " << sizeof(int) << endl << "long " << sizeof(long) << endl << "float " << sizeof(float) << endl << "double " << sizeof(double) << endl << "long double " << sizeof(long double) << endl; }