使用struct中定义的类型作为struct中函数参数的类型

时间:2018-07-16 01:57:17

标签: c

ALLBUT=...,cParen,...

我如何在结构中使用* valid be Flag参数?

1 个答案:

答案 0 :(得分:1)

您正在寻找的typedef如下:

typedef struct flag
  {
           int8_t (*valid)(struct flag flag);
    const uint8_t requiresValue;
    const char*   name;
          uint8_t active;
          char*   value;

  } Flag;

我将Flag更改为struct flag。请注意,由于第一行flag,小写的typedef struct flag

相关问题