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

C Language 2990409057996577177

Post a Comment

emo-but-icon

item