A dynamically created array of objects should use a non-default constructor, and I consider the problem I am facing as syntax. In my opinion, the fact that I can do it
int * somePtr = new int[5];
means i have to do this
IntegerSet* someSet = new IntegerSet(this->getLength())[5];
where IntegerSet is the class I made representing an integer set. this code occurs inside one of the member functions of IntegerSets. When I try to do this, I get the syntax error "cannot convert from IntegerSet to IntegerSet *"
I understand what this means, these two types are not equivalent, but I do not see the difference between what I did in parts 1 and 2, except that part 2 should have a list of arguments as a constructor. So it is in this part of the code that I suspect that I have the wrong syntax
Johna source share