How do you know the size of Structure Variables?


We may use the unary operator ‘sizeOf’ to tell us the size of a structure (or any variable). The expression:

SizeOf( struct x);

Will evaluate the number of bytes required to hold all the members of the structure x. If y is a simple structure variable of type struct x, then the expression

SizeOf(y);

would also give the same answer. However, if y is an array variable of type struct x,
then

sizeOf(y);

Would give the total number of bytes the array y requires.


Related

Write about various Looping (or) Iterative Statements Available in ‘C’?

The statements that are used to execute the block of the statements repeatedly are called looping statements. C language provides 3 constructs for performing loop operations. They ar...

Write about Additional Features of For Loop?

The for loop in C has several capabilities that are not found in other loop constructs. 1.More than one variable can be initialized at a time in the for statement. Ex:– for(p=1...

Comments in C Language

The lines beginning with /* and ending with */ are known as comment lines. These are used in a program to enhance its readability & understanding comments are included in a ‘C’ program when e...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item