q C++ provides a special operator sizeof which gives the size in bytes of any data type
qcout << "unsigned
char = " << sizeof(unsigned char) << endl; // unsigned char = 1
qcout << "char =
" << sizeof(char) << endl; //
char = 1
qcout << "short =
" << sizeof(short) << endl; // short = 2
qcout << "int =
" << sizeof(int) << endl; // int = 4
qcout << “float = "
<< sizeof(float) << endl;
// float = 4
qcout << “double = "
<< sizeof(double) << endl;
q
// double = 8
q
n