简体   繁体   English

struct声明typedef struct A {…} B是什么? 意思?

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

What is the name of the struct below — node_t or node ? 下面的结构的名称是node_tnode什么? 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 . 您正在为struct node_t定义一个名称( node )。

It allows you to create the structure using node myStruct instead of struct node_t myStruct . 它允许您使用node myStruct而不是struct node_t myStruct创建结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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