Oh yeah. I remember the pain of figuring when to use the > vs . operators. pointer references or whatever. OUCH!!! Well, I will go through it again. 2 reasons. The structure needed for the initializer variables, then the data log which is a PERFECT structure application. so as I remember it will be struct_name>item, but log-array[x].item. or maybe I have it backward. I have to check. Once you get it down it is nice and easy. Confusing otherwise. -Tony --- In AVR-Chat@yahoogroups.com, Robert Adsett <subscriptions@a...> wrote: > 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: need variables to be stored in EEPROM
2005-04-25 by arhodes19044
Attachments
- No local attachments were found for this message.