I have a problem and I was wondering if someone could help.
Suppose I have a class A, with the following definition:
1 2 3 4 5
publicclass A
{
A(int x, int y);
~A();
};
Then suppose, I have a class B, that needs class A as one of it's members:
1 2 3 4 5 6 7 8
publicclass B
{
B();
~B();
private:
A;
};
How would I then supply both the ints as arguments to the constructor of A? I have been getting around this, by declaring A to be on the heap, and then when I create a new instance of A with the new operator in B's constructor I can pass in the arguments then, but does anyone know how to do this with A being on the stack?