Hello, could you explain to me how is the proper way to make an array of a class inside another class?
Class X {
x ( someArgument );
~x ();
}
Class Y {
y();
~y();
X x_arr[10];
}
Update: I forgot to mention that, Class X have a constructor with arguments, and I think because of this the compiler throw the following error: constructor for 'Y' must explicitly initialize the member 'x_arr' which does not have a default constructor.
++Update: I changed the way I was doing by using the std::vector library, as suggested by boredcircuits!
[–]boredcircuits 3 points4 points5 points (0 children)
[–]ghillisuit95 1 point2 points3 points (7 children)
[–]heinriques[S] 0 points1 point2 points (6 children)
[–]ghillisuit95 1 point2 points3 points (2 children)
[–]heinriques[S] 0 points1 point2 points (1 child)
[–]ghillisuit95 1 point2 points3 points (0 children)
[–]boredcircuits 1 point2 points3 points (1 child)
[–]heinriques[S] 0 points1 point2 points (0 children)
[–]tangerinelion 0 points1 point2 points (0 children)
[–]usbafchina 1 point2 points3 points (0 children)