Sizeof Operator in C++

Level 128 keystrokes

Prints the size of the int type in bytes, which is 4 on common platforms.

C++ code

// sizeof(int) gives the size of the int type in bytes
// The size is implementation-defined; it is 4 on today's common platforms
1cout << sizeof(int) << endl;

Output

4
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this C++ code and how often they appear.

  • <× 4
  • ;× 1
  • (× 1
  • )× 1

More C++ examples at level 1

← C++ typing practice