📌  相关文章
📜  字段 '' 声明为函数 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:38.298000             🧑  作者: Mango

代码示例1
struct stack {
    char x[LIMIT][10];
    int top;
    void (*push)(struct stack *, char *);
    char *(*pop)(struct stack *self);
    void (*init)(struct stack *self);
    bool (*is_empty)(struct stack *self);
};

struct stack object;
object.push = push_function; // function defined elsewhere
object.pop = pop_function;   // function defined elsewhere
// ...