Hi guys!
I'm not a specialist for ANSI C (or regular C at all), so I stumbled about this stupid thing:
I want to initialize a struct element, splitted in declaration and initialization. This is what I got:
typedef struct MY_TYPE {
boolean flag;
short int value;
double stuff;
} MY_TYPE;
void function(void) {
MY_TYPE a;
...
a = { true, 15, 0.123 }
}
Is this the way to declare and initialize a local variable of MY_TYPE in ANSI C? Or is there anything better or at least working.
I feel sorry to ask this. %-)
Update I ended up having a static initialization element where I set every subelement according to my needs.