If I have a class, MyClass, can I declare an array of MyClass on the heap, within the constructor of MyClass?
I can do this in C# but it doesnt seem to like it in C++?
I also get an error about no appropriate constructor for type MyClass??
class MyClass
{
public:
MyClass(int);
private
MyClass* array;
};
MyClass::MyClass(int size){
array = new MyClass[size];
}