In C++,How can I declare an array of objects with a compulsory string type argument(for parametrized constructor) of a certain size where size will be provided by user at runtime? Suppose 'Vertex' is my class which requires a string type argument for passing to parameterized constructor while declaring the object of 'Vertex'. When I write
Vertex s=Vertex("xx");
it is OK for declaring a single object. But I want the array size to be of N,which will be obtained from user at runtime.
In a nutshell,I want to have Vertex obj[N].What is the syntax for achieving that?
** I want my array of objects with a compulsory string argument to be passed for the parametrized constructor of my class.The said duplicate linked question doesn't have that criteria.**