Hey everyone,

I'm attempting to write a header file, example.h that will contain function declarations that will be defined in example.c. For some reason Its giving me an error when i do this

extern void mainMenu(node*);

Now node is a struct defined in another header file, should I include that as an extern variable as well?

Something like extern struct node; ??

Thanks for the help in advance.

10 Years
Discussion Span
Last Post by Barefootsanders

>>should I include that as an extern variable as well?
No. All you have to do is include the head file that defines the struct at the top of example.h. And don't forget to use code gards in both head files.


Thanks a lot. That solved it right up. Thought I could get away without including it and just declaring it as an extern but I guess theres no way around it. Thanks again.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.