Re: Newbie question on unions
From: Ron Natalie (ron_at_sensor.com)
Date: 10/11/04
- Next message: Gernot Frisch: "reference to array?"
- Previous message: Victor Bazarov: "Re: most accurate printf("%f")"
- In reply to: Rolf Magnus: "Re: Newbie question on unions"
- Next in thread: Default User: "Re: Newbie question on unions"
- Reply: Default User: "Re: Newbie question on unions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 11 Oct 2004 10:05:29 -0400
Rolf Magnus wrote:
> Reading a member of a union after writing to another one is not allowed in
> C++. Most platforms I know will just give you a reinterpretation of the two
> char values as one short value, but the right tool to do this is a
> reinterpret_cast.
Except in the case of reading from a char or unsigned char aliased to
something else (unfortuntaely, this is the opposite of what is happening
in this case).
- Next message: Gernot Frisch: "reference to array?"
- Previous message: Victor Bazarov: "Re: most accurate printf("%f")"
- In reply to: Rolf Magnus: "Re: Newbie question on unions"
- Next in thread: Default User: "Re: Newbie question on unions"
- Reply: Default User: "Re: Newbie question on unions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|