-
classes
Here goes me again, I'm sorry to be asking so many questions, which aren't all that inteligent.
This time what i need to do is have 2 classes and an object of the other class
something like this:
Code:
class A1
{
B2 b;
};
class B2
{
A1 a;
};
How would you go about this?
-
What are you really trying to do?
If you could compile the code you posted, what do you think happens when you create an object of A1? It will create an object of B2, which in turns creates an object of A1 separate from the previous one, which in turns creates an object of B2 separate from the previous one, which in turn ......
One thing that you can do is this:
Code:
class B2;
class A1
{
B2* b;
};
class B2
{
A1* a;
};
-
So it basicly enters an infinte loop when you try to do something like that? Interesting
Well thanks, works now.