In the code below I would like array to be defined as an array of size x when the Class constructor is called. How can I do that?
class Class { public: int
Instead of using a raw array, why not use a vector instead.
class SomeType { vector v; SomeType(size_t x): v(x) {} };
Using a vector will give you automatic leak protection in the face of an exception and many other benefits over a raw array.