I'm trying to write a C program using GCC with four different moduals. e.g. 1.cpp, 1.h, 2.cpp, 2.h etc. I would like to build a structure that
all moduals can use. I have a structure in 1.h
and can use it in 1.cpp but I can't seem to pass the structure to functions in the other files without error. The all functions need to use the same variables.
Thanks in advance
Solution for .........
Please make the struct var. extern where you want to use.Please try it out using this..........
Hope so it will solve your problem.
make sure you have "i.h" #include-d in your "2.cpp"