Circular definition in C

后端 未结 1 584
一向
一向 2021-01-23 21:12

What I\'ve written is:

typedef enum _MyStatus
{
    MY_STATUS_OK = 0,
    MY_STATUS_GENERAL_ERROR = -1,

} MyStatus;

typedef MyStatus (*MyCallback)(MySettings *         


        
相关标签:
1条回答
  • 2021-01-23 21:32

    How about putting this line at the top:

    typedef struct _MySettings MySettings;
    

    This C FAQ: How can I define a pair of mutually referential structures? might be of use.

    0 讨论(0)
提交回复
热议问题