I am stumped at this step while implementing a ternary tree:
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef struct tnode *Tptr;
typedef struct node
{
char splitchar;
Tptr lokid,eqkid,hikid;
}Tnode;
int research(Tptr p,char *s)
{
if (!p) return 0;
if (*s<p->
}
int main(){
return 0;
}
When I move the mouse icon near the p, it shows me a red color and error:
pointer to incomplete class type is not allowed
My question is exactly what is an incomplete class? Please help me, thanks.
You’ve typedef’d
Tptras astruct tnode *, buttnodeis not defined or even declared. Perhaps you meant to name yournodestructtnodeinstead?BTW, there’s an easy way to keep that from happening in the future…
At that point,
Tptris always an alias to the correct type, even if you changetnode‘s name to something else.