when creating header file sometimes I need to have access to other struct that I have declared in the other header files. Currently I organize it by having the #include Directive
as a tree so that if I need to call the struct
in b
from a
I place a
header underneath b
in main
.
Probably a bad practice I am NEW to C.. don't be harsh :P
where should I declared the struct for it to be accessible on the entire code?
should I create a header file with all my struct inside and then call it by doing an #include Directive
on all the header files? what is the best practice to declare a struct for a beginner.
I currently access to other struct declared in other header files as such
//main file
#include "b.h"
#include "a.h" <--- I had to put a.h underneath b.h to access to the struct in b.h named test
#include "c.h"