Question about size and memory layout of a Union.

J

James Kuyper Jr.

pete said:
Nothing does.

"next to each other" doesn't mean anything.
Bits in the same byte are only distiguishable
by the values that they represent.

Yes, but those bits can represent values in at least two different
types: the 32 bit type, or unsigned char. It's both meaningful, and
important, to realize that the standard imposes no requirements
connecting the value represented by a given bit in those two different
types.

Exception: if unsigned char is a 32 bit type, and the 32 bit integer
type we're comparing it with is char, signed char, or unsigned char,
then there is a required connection, of course.
 

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

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top