> 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. " > > I'd go as far as saying that C should have been provided with something > that did what you're trying above. As an ex-assembly language programmer, > I resent being told how I can access my data :-) You don't really NEED unions, you can just go with (unsigned char*)&myFloat to read the value as bytes: unsigned char* bytes = (unsigned char*)&myFloat; eeprom_write(bytes[0]); eeprom_write(bytes[1]); eeprom_write(bytes[2]); eeprom_write(bytes[3]); Something like that. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist