In order to create an array of ints dynamically, I need to do int *a = new int[20];.
Is there a similar way to create an array of objects or structs?
For example, I need a dynamically allocated array of objects of class A, how should I declare it(Syntax)?
What constructor would be called on each object(if at all any constructor is called)?
A* a = new A[20];, and the default ctor will be called.std::vectorinstead ofnewexpression?std::vector. But How does it actually work?