C++ examples for Operator:sizeof
Sizeof gives you information about the amount of memory allocated for data items.
#include <iostream> using namespace std; int main() {/* w w w . j a v a 2s.c o m*/ cout << "sizeof(double) = " << sizeof(double); cout << ", sizeof(char) = " << sizeof(char); int x; int i = sizeof x; }