typedef struct clarity

前端 未结 6 1607
悲&欢浪女
悲&欢浪女 2021-01-03 11:31

I am getting confused with typedef can anyone transcribe this to a normal composition? of structures? I really don\'t want to handle typedef since it\'s gets me confuse

6条回答
  •  北海茫月
    2021-01-03 11:52

    A more common way to write the very same would be:

    typedef struct stackNode
    {
      int data;
      struct stackNode *nxtptr;
    
    } StackNode_t;
    

    where stackNode is the so called "struct tag" and StackNode_t is the actual name of the type. If you declare structs like this, the rest of the program won't need to concern itself with the struct tag, and you can use nxtptr as if it was of StackNode_t.

提交回复
热议问题