I need to pass some structure as function argument like this
void myFunc(unsigned char c);
I will use myFunc(4)
, myFunc(8)
or so.
Now the function accepts a structure as argument, so I tried
typedef struct {
unsigned char address;
unsigned char command;
unsigned char group;
unsigned char response;
unsigned char flags1;
unsigned char flags2;
}test_t;
void myFunc(test_t test);
myFucn({0,0,0,0,0}); // but this gives me error
How can I pass const struct as argument without to have to instantiate first ? Just like myFunc(4) as unsigned char.
Thanks