简体   繁体   中英

What does the struct declaration typedef struct A { … } B; mean?

What is the name of the struct below — node_t or node ? Why is there any difference?

typedef struct node_t
{
    int data;
    struct node_t *right, *left;
}   node;

You are defining a name ( node ) for the struct node_t .

It allows you to create the structure using node myStruct instead of struct node_t myStruct .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM