Here is a piece of code that's confusing me.
struct tNode {
int key; // search key for this item
int data; // data for this item
struct tNode *left, *right; // children
};
typedef struct tNode tree_type;
/**************** tree_new() ****************/
/* Create a new tree */
tree_type *
tree_new(const int key, const int data)
{
tree_type *node = malloc(sizeof(struct tNode));
...
}
}
tree_type *
You have to read both lines together:
tree_type *
tree_new(const int key, const int data)
is just another legal way to write the function definition with its return type:
tree_type *tree_new(const int key, const int data)
since it doesn't end with a semicolon, the statement continues on the next line(s).