Sizeof Operator in C

Level 129 keystrokes

Outputs the size of an int type in bytes using sizeof (usually 4).

C code

// sizeof returns the size of a type in bytes
// %zu prints size_t; the result is usually 4, but it depends on the platform
1printf("%zu\n", sizeof(int));

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.

  • "× 2
  • (× 2
  • )× 2
  • ,× 1
  • ;× 1
  • \× 1
  • %× 1

More C examples at level 1

← C typing practice