sizeof unpadded struct size

N

Nomen Nescio

Eric said:
Here's an analogy, inaccurate as analogies always are but
perhaps it will help you understand: What is your weight, not
counting your water content? You could add up the weight of
the collagen and cartilage, the bones and bursae, and all the
other non-watery bits and pieces of yourself, and announce a
number. But would that number have anything to do with "your"
weight? The water is an essential part of "you," just as the
padding is an essential part of the struct: Neither you nor
the struct can exist without your essential ingredients, and
a measurement that ignores essential ingredients is not very
meaningful.

You must be having a long day, Eric. That analogy is worthy of
Chuck, not you.

Anyone in the medical profession or fitness industry knows the
meaningfulness of determining lean body mass as opposed to total
body mass. The OP could reason that structure padding is like
storage lipid, and he could be seeking the lean structure size
for whatever reason.

The very existence of offsetof() indicates that not all programmers
wish to consider structure padding as completely transparent and
meaningless, a postmodern social construct whose description
consists of abstruse profundities on the level of Zen koans.


Yours,
Han from China
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top