Skip to main content
added 35 characters in body
Source Link
Cliff B
  • 69.3k
  • 4
  • 33
  • 56

Are you trying to define a new struct? The command struct node* root; is an attempt to do so. You've previously defined a struct with the typedef command.

Instead, just remove the word struct and do this:

 node* root;
 root = malloc(sizeof(node));

This creates a variable called root that is a pointer to a node structure.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

Are you trying to define a new struct? The command struct node* root; is an attempt to do so. You've previously defined a struct with the typedef command.

Instead, just remove the word struct and do this:

 node* root;

This creates a variable called root that is a pointer to a node structure.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

Are you trying to define a new struct? The command struct node* root; is an attempt to do so. You've previously defined a struct with the typedef command.

Instead, just remove the word struct and do this:

 node* root;
 root = malloc(sizeof(node));

This creates a variable called root that is a pointer to a node structure.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

Source Link
Cliff B
  • 69.3k
  • 4
  • 33
  • 56

Are you trying to define a new struct? The command struct node* root; is an attempt to do so. You've previously defined a struct with the typedef command.

Instead, just remove the word struct and do this:

 node* root;

This creates a variable called root that is a pointer to a node structure.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)