so, I have been given a header file that contains typedefs for structs
I have to define said structs in a source file and I am unable to modify the header
What kind of restrictions does this impose upon any of these structs I create?
In my header file I have
typedef struct tldnode TLDNode;
In my source file I have
struct tldnode
{
int count;
char *tld;
TLDNode *left;
TLDNode *right;
};
I get a segfault when running my program, and using GDB I have found at the point of the fault I am uinable to print the value of any of the TLDNode members because I cannot access the memory locations
Is this related to the way the struct is defined, like I mention at the top, or likely to be something else?
A weird note, the memory location of the TLDNode pointer is the same location as the first member (int count), I am pretty sure this means I screwed up somewhere with memory allocation but not sure