On Thu, May 15, 2003 at 04:24:54PM -0700, Brian Aase wrote: > > > > That may work in your compiler, which is fine, but it's not *guaranteed* > > to work by the C standard. > > ...and why would that be? Only because sizeof(float) may vary, which has > been covered here earlier, or are there other reasons too? In the standard the value of a union member other than the last one stored into is undefined (or unspecified depending on which standard you use). This kind of minutia often creates big flamewars (err, discussions, yes, that's it) but all I wanted to emphasize was the part you ed above. Go ahead and rely on the behavior that your environment happens to provide if you want. But don't try this trick if you need to work across compilers and platforms, because in most cases the behavior you get is the "natural" behavior (ie whatever just fell out when the well defined parts were done). -- Ben Jackson http://www.ben.com/ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body