C Function Prototype With Struct Argument

后端 未结 2 1763
忘掉有多难
忘掉有多难 2021-01-13 06:46

I want to write a function prototype for a function, whose argument is a pointer to a struct.

int mult(struct Numbers *n)

However, the str

2条回答
  •  遥遥无期
    2021-01-13 07:26

    Just declare struct Numbers as an incomplete type before your function declaration:

    struct Numbers;
    
    int mult(struct Numbers *n);
    

提交回复
热议问题