Reputation: 110
typedef struct flag
{
int8_t (*valid)(Flag flag);
const uint8_t requiresValue;
const char* name;
uint8_t active;
char* value;
} Flag;
How do i have the parameter for *valid be Flag inside the struct?
Upvotes: 0
Views: 40
Reputation: 7750
The typedef you are looking for is as follows:
typedef struct flag
{
int8_t (*valid)(struct flag flag);
const uint8_t requiresValue;
const char* name;
uint8_t active;
char* value;
} Flag;
I changed Flag
to struct flag
. Note the lowercase flag
due to the first line typedef struct flag
.
Upvotes: 1