At 07:16 PM 4/25/05 +0000, arhodes19044 wrote: >It has been a long time since I worked with structures. Is there a >way to get the offset of the element within the structure? >Something like "&structure.element". This way, I can start with the >location of the structure in SRAM or in EEPROM and then access the >individual element by base + offset. Will sizeof() work with >structure elements? Look for the standard macro offsetof(). And yes sizeof works with structure elements, although depending on the compiler and micro adding up the sizes of the previous elements will not necessarily give the same answer as offsetof (I expect it would on an AVR). Robert " 'Freedom' has no meaning of itself. There are always restrictions, be they legal, genetic, or physical. If you don't believe me, try to chew a radio signal. " -- Kelvin Throop, III http://www.aeolusdevelopment.com/
Message
Re: [AVR-Chat] Re: need variables to be stored in EEPROM
2005-04-25 by Robert Adsett
Attachments
- No local attachments were found for this message.