simple class question

Started by
3 comments, last by Dwiel 22 years, 3 months ago
I know this is probobly a stupid question, but how would I acomplish this with out the compiler erroring?: class a { b BB; }; class b { a AA; }; Probobly basic question, but I can''t think right now. Thanx alot Zach Dwiel ~ Tazzel3d
Advertisement
do this...

class b;

class a
{
b BB;
};

class b
{
a AA;
};



...go on and live with no regrets, you only have one life...
...go on and live with no regrets, you only have one life...
You CAN''T do what you''re displaying since you''d have an infinitely large variable type. You can do this though:
  class B;class A {  B *Fish;};class B {  A *Fish;};  

People ask questions just like this way too often.

[Resist Windows XP''s Invasive Production Activation Technology!]
Thanx for the hlep guys, I sometimes know something is simple and used to know it, I just have like a mind freeze, and I agree with you NULL and VOID, there are to many people asking these kinds of questions, only because not everybody looks in MSDN before they come and waste our time.

Tazzeld
come on guys, if someone asks dumb questions that u don''t want to answer, just don''t answer them... then they won''t be wasting your time... but you know what does waste time? telling people that they ask dumb questions

...go on and live with no regrets, you only have one life...
...go on and live with no regrets, you only have one life...

This topic is closed to new replies.

Advertisement