C++ sizeof

In this tutorial you will learn about the C++ sizeof and its application with practical example.

C++ sizeof

In C++, the sizeof operator is used to determines the size of a variable or any data type. It is a compile-time operator which returns the size of variable or data type in
in bytes.

Syntax:-

Here, type include variables, constants, classes, structures, unions, or any other user defined data type.

Example:-

Output:-

Size of Variables

Example:-

Output:-

Size of Constant

Example:-

Output:-

Nested sizeof operator

Example:-

Output:-

In this tutorial we have learn about the C++ sizeof and its application with practical example. I hope you will like this tutorial.