I have a class of the following form:
class T
{
public:
/// Constructor
T(const std::string& baseName);
};
Now within the main() method I am trying to create an array of the objects of the class using:
T* s = new T[20](baseFileName);
I am not getting where I am making a mistake...can someone please help.
The error which I am getting is:
error: ISO C++ forbids initialization in array new [-fpermissive]
std::vector<T> s(20, T(baseFileName));(which frankly, you should be using anyway rather than allowing raw pointers to own dynamic resources).