C – Sizeof Operator

C – Sizeof Operator 2017-06-12T10:15:52+00:00

sizeof operator

The sizeof operator returns the size of its operand in bytes. The sizeof operator always precedes its operand. The operand may be an expression or it may be a cast.

Example:

Suppose i is an integer variable and c is a character type variable then

Printf(“Size of integer : %d”,sizeof(i));
Printf(“Size of character : %c”,sizeof(c));

Might generate the following output :
Size of integer : 2
Size of character : 1

Output :

Size of Integer        :2

Size of Floating Point       : 4

Size of Double           : 8

Size of Character      : 1

 

Prev Next