The code I'm working with:
http://www.arduino.cc/playground/Code/EEPROMWriteAnything
I know it works, but if I can understand HOW, it'll be way better. So...
There's no mention of 'struct' in the reference pages, but I understand that it makes something like a group variable. What is the 'config_t'? I couldn't find much googling it.
struct config_t
{
long alarm;
int mode;
} configuration;
It's called a "tag". It's somewhat like a typedef. It allows you to create multiple instances of the structure...
struct config_t ConfigLoadedFromStorage;
struct config_t UserModifiableConfig;
Ah, I got, after looking up 'tag', this is very clear:
http://www.exforsys.com/tutorials/c-language/c-structures-and-unions.html
...so it's optional.
...no, it doesn't seem to be optional like that webpage says, at least it doesn't compile without it.
It is optional. This compiles without error...
struct
{
long alarm;
int mode;
} configuration;
void setup( void )
{
}
void loop( void )
{
}