B
Bill Cunningham
The compiler tells me in lines 19 and 20 there is a dereferencing to an
incomplete type. I don't know what that means much less than what to do with
it. Here's the code --
#include <stdio.h>
struct node *build(void)
{
struct node *root = NULL;
root = (struct node*)insert(root, 2);
root = (struct node*)insert(root, 1);
root = (struct node*)insert(root, 3);
return (root);
};
int maxDepth(struct node *node)
{
if (node == NULL) {
return 0;
}
else {
int ldepth = maxDepth(node->left);
int rdepth = maxDepth(node->right);
if (ldepth > rdepth)
return (ldepth + 1);
else
return (rdepth + 1);}
}
This with be compiled into an object file and compiled with another object
file and source to create a binary.
Bill
incomplete type. I don't know what that means much less than what to do with
it. Here's the code --
#include <stdio.h>
struct node *build(void)
{
struct node *root = NULL;
root = (struct node*)insert(root, 2);
root = (struct node*)insert(root, 1);
root = (struct node*)insert(root, 3);
return (root);
};
int maxDepth(struct node *node)
{
if (node == NULL) {
return 0;
}
else {
int ldepth = maxDepth(node->left);
int rdepth = maxDepth(node->right);
if (ldepth > rdepth)
return (ldepth + 1);
else
return (rdepth + 1);}
}
This with be compiled into an object file and compiled with another object
file and source to create a binary.
Bill