• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# simple class question

## Recommended Posts

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

##### Share on other sites
do this...

class b;

class a
{
b BB;
};

class b
{
a AA;
};

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

##### Share on other sites
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!]

##### Share on other sites
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

##### Share on other sites
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...

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627654
• Total Posts
2978451

• 10
• 12
• 22
• 13
• 33