Typeef and structure definition

Asked 1 weeks ago, Updated 1 weeks ago, 1 views

typedef struct _node { LData data; struct _node * next; } } Node;

Is it correct to call 'structure_node' as 'Node' in the code that will come out later using typeef?


2022-09-20 10:50

1 Answers

Typeef is used to nickname the data type.

typedef int Data;

For example, after declaring as above, you can declare a variable with inta; or Dataa;. It is used to make a nickname by giving meaning to the data type, to shorten the length of the data type, or to not want to change the code of the destination like a macro constant.

typedef struct _node {
    LData data;
    struct _node * next;
} } Node;

The code for the question is the structure data type, which is nicknamed Node. If you are nicknamed as above, you can shorten variable declarations that need to be declared, such as structure_nodea;, such as nodea;.

2022-09-20 10:50

If you have any answers or tips

© 2022 pinfo. All rights reserved.