What's the best way to create a n array of classes?
So I have two classes, A and B. And I want to create an array of A in B. What's the best way to do this?
Should I just create an array normally like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
class A
{
private:
int x, y;
public:
void DoSomething();
};
class B
{
private:
vector<A> arr;
};
| |
Or could I have a nested class like so:
1 2 3 4 5 6 7
|
class B
{
private:
class A {};
vector<A> arr;
};
| |
Or perhaps some other method? Thanks.
Topic archived. No new replies allowed.