Dynamic memory with my class
Hi,
I'm trying to make something like this:
MyClass mc = new MyClass[size];
'size' here is an int variable.
But I get this error from the compiler:
error C2512: 'MyClass' : no appropriate default constructor available
|
What do I do wrong and how do I fix it?
Thanks in advance!
I think I need to apply a [] operator in my class, but I don't know how that works yet.
Ok nvm, I found out that I needed to make the default constructor, wich is MyClass().
Topic archived. No new replies allowed.