Is there any way to dynamically (I think that's the right term) define an int array in a class, the size of which is a private member variable in that same class? For example:
class Scene()
{
//public member functions
private:
int max;
int xcoords[max];
}
I've searched through other answered questions on here, but I haven't learned how to use vectors in class yet, which is what most responses suggest. Ideally, in my constructor for the class, I'd be passed an int max, with which I then initialize the xcoord array to have a size of max with entries all -1.
xcoordstoint*and in the constructor assign memory dynamically asxcoords = new int[max];