Is there a way to get to get this to work...
// header1.h
struct s1{
struct s2 * s2_ptr;
};
// header2.h
struct s2{
struct s1 * s1_ptr;
};
I think i've seen the kernel do it but i cant find it again to replicate.( if i wasnt dreaming );
Is there a way to get to get this to work...
// header1.h
struct s1{
struct s2 * s2_ptr;
};
// header2.h
struct s2{
struct s1 * s1_ptr;
};
I think i've seen the kernel do it but i cant find it again to replicate.( if i wasnt dreaming );
"Assumptions are the mother of all **** ups!"
This should work (I don't have a compiler right now).
Code:struct s2; struct s1{ struct s2 * s2_ptr; }; // header2.h #include <header1.h> struct s2{ struct s1 * s1_ptr; };
Last edited by XSquared; 04-07-2004 at 05:43 AM.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Both have to end up in the same scope though. Becuase you must complete all "incomplete references".Code:/* st1.h */ struct s2; /* we use an "incomplete reference" */ struct s1 { struct s2 *s2ptr; }; /* st2.h */ struct s1; struct s2 { struct s1 *s1ptr; };
[edit]
Curses, foiled again.
[/edit]
Quzah.
Hope is the first step on the road to disappointment.