Sizeof Operator in C Programming

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

Example:

Ready to get started?

Ready to embark on your journey into the world of C programming? Our comprehensive course provides the perfect starting point for learners of all levels. With engaging lessons, hands-on exercises, and expert guidance, you'll gain the skills and confidence needed to excel in this fundamental programming language. Let's dive in and unlock the endless possibilities of C programming together!