Been trying to solve this problem for a while and I just can't fix it. I'm a student still learning C so I might be doing something completely wrong but I can't see it. I'm trying to declare two new struct pointers. I've tried initiating them to NULL but nothing. I'm stumped. I assume I'm trying to something I can't do but I don't know what it is. Thanks.
Here's my struct:
struct node {
int key;
int count;
struct node *left, *right;
};
typedef struct node node;
Here's where I'm trying to declare:
node *insert_node(node *root, node *node) {
node *pTraverse = root;
node *currentParent = root;
}
Here are the errors:
assign6.c: In function 'insert_node':
assign6.c:15: error: 'pTraverse' undeclared (first use in this function)
assign6.c:15: error: (Each undeclared identifier is reported only once
assign6.c:15: error: for each function it appears in.)
assign6.c:16: error: 'currentParent' undeclared (first use in this function)