Confused by #define and typedef

后端 未结 4 2109
鱼传尺愫
鱼传尺愫 2021-01-07 01:27
#define T Stack_T
typedef struct T *T;

Then what does T in struct T mean,the one defined by #define or

4条回答
  •  南笙
    南笙 (楼主)
    2021-01-07 01:28

    The T represents Stack_T so, you can read the typedef as:

    typdef struct Stack_T *Stack_T;
    

    so every T in your code is replaced as Stack_T during compiler compilation.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题