Sizeof gives you information about the amount of memory allocated for data items. - C++ Operator

C++ examples for Operator:sizeof

Description

Sizeof gives you information about the amount of memory allocated for data items.

Demo Code

#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;
}

Result


Related Tutorials