Hi everyone,
Well, I have 3 classes in 3 files:
Main class father, at father.h:
at son.h:Code:#if ! defined ( Father_C ) #define Father_C #include <stdio.h> #include "son.h" #include "daughter.h" class Father { private: son *sons; daughter *daughters; public: Father(){ son jack; }; ~Father(); }; #endif
at daughter.h:Code:#if ! defined (Son_C ) #define Son_C #include <stdio.h> #include "daughter.h" class son { private: daughter *sisters; public: son(){ daughter jamie; }; ~son(); }; #endif
Code:#if ! defined (Daughter_C ) #define Daughter_C #include <stdio.h> #include "son.h" class daughter { private: son *brothers; public: daughter(){ son jack; }; ~daughter(); }; #endif
But it doesnt work, I am unable to reference 2 classes between themselves, as I did in the example with son and daughter. I would like to references those clases between them and with the father, as i did at the example.
I know it is not much difficult, I will appreciate a lot any help or references.
Thank you very much
David



LinkBack URL
About LinkBacks


