In c++ its something like this:
struct node{
int value;
node *left;
node *right;
};
and in function, when i need it, il use it like this:
node *r;
r = new node();
r -> inf = 1;
r -> left = r -> right = null;
but how is this working in C ? i tryed:
struct node{
int value;
node *left;
node *right;
};
but i got error: indentifier node is undefined, so i changed in:
struct node{
int value;
struct node *left;
struct node *right;
};
but now, if i try to make a new variable:
node *r;
i get error: identifier node is undefiner at *r declaration line, What am I doing wrong?