On Tue, 27 Mar 2007, Barry Gershenfeld wrote: > I have long wanted something that could do this, but alas, my K&R tells me: > > " Any of these types may be assigned to u and then used in expressions, so > long as the usage is consistent: the type retrieved must be the type most > recently stored. It is the programmer's responsibility to keep track of > which type is currently stored in a union; the results are > implementation-dependent if something is stored as one type and extracted > as another. " That doesn't mean you can't do it; it just means that the behavior is not defined by the standard and thus is not portable between different compilers. If you want to do it portably, convert the address of the float to an unsigned char pointer, and use the pointer to walk through the bytes of the float. -- John W. Temples, III -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist