C Typedef and Struct Question

前端 未结 5 1868
别那么骄傲
别那么骄傲 2020-11-28 11:39

What\'s the difference between these two declarations, and is one preferred over the other?

typedef struct IOPORT {  
    GPIO_TypeDef* port;  
    u16               


        
5条回答
  •  醉酒成梦
    2020-11-28 12:08

    the first allows you to use IOPORT inside the struct for refering to objects of the same type. useful in cases such as linked lists where a node has to refer to a node.

提交回复
热议问题