0
struct node{
  int data;
  node *r_child;
  node *l_child;
  node parent;
};

Why node parent line get error? please help me Error message(field 'parent' has incomplete type 'node')

  • 2
    Needs to be a pointer. – jackl May 14 '21 at 18:29
  • 2
    What is the error message? That would motivate more people to answer. You can't put the same struct inside a struct. That would might cause the node struct size to grow infinitely. node { .... node { .... node{ ... infinite nodes } } } Which of course limited memory can't withhold. – Aesop May 14 '21 at 18:34

0 Answers0