G
G
Gimir2018-02-10 00:02:42
C++ / C#
Gimir, 2018-02-10 00:02:42

How does the struct function work in C?

In principle, I understand how this function works, but I encountered a "misunderstanding" when creating a Linked list, here is the code:

typedef struct node 
{
     int n;
     struct node* next;
}
node;

Explain on the fingers - how it works?
In particular, I can't understand how the line works . I understand the first line, an int variable with the name n is declared, I also understand how to use it, for example -struct node* next;
node number;
number.n = 3;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2018-02-10
@Gimir

Generally, this data type declaration is a structure. There is a description of working with structures - here
String is the declaration of a member of a structure of the pointer type, to data of the same type of structure. struct node* next;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question