Re: Union trouble
"Bartc" <bc@xxxxxxxxxx> wrote:
Is there a way of using unions transparently, so that the union name doesn't
get in the way?
So:
union {int a,b;} u;
a=1;
instead of:
u.a=1;
No.
In particular when the union is inside a struct.
I believe Ganuck offers this as an extension, but it's not ISO C.
Richard
.
Relevant Pages
- Re: All programs are undefined, Re: Why this works???
... terms of the capabilities of a particular machine about whose details ISO ... void printat(const char *s, int x, int y, int bg, int fg) ... If this technique were not well-defined under the above circumstances, ... these programs were able to rely on the well-definedness of this technique ... (comp.lang.c) - Re: Number of weeks in year?
... >produce results incompatible with ISO 8601" ... >private int WeekNumber_Entire4DayWeekRule ... > StartWeekDayOfYear = StartWeekDayOfYear; ... > EndWeekDayOfYear = EndWeekDayOfYear; ... (microsoft.public.dotnet.languages.csharp) - Re: Garbage Collection - Stop Making Trash
... > as soon as the ECMA standard is ratified, it will be submitted to ISO. ... int main ... pointer, it cannot be moved by the GC and will not be garbage collected. ... (comp.lang.cpp) - Re: code portability
... All the ISO guys had to do was - nothing at all! ... wrongly assumes long int is precisely 32 bits is already broken, ... long as you can spare the space), and don't worry about changing data ... most companies don't switch compilers too often. ... (comp.lang.c) - Re: Public disclosure of discovered vulnerabilities
... to the int value -64? ... A sign extension is ... Had you used the proper type, unsigned char, instead, ... the conversion to int would *not* have sign- ... (sci.crypt) |
|