I know I can do new char[n] to create an array of n chars. This works even when n is not a compile time constant.
new char[n]
n
But lets say
Let's keep things short and sweet in C++ using std::vector.
std::vector
struct Test { std::size_t size; char *a; // Modified to pointer Test( int size ): size(size), a(new char[size+1]) {} }; std::vector objects(numberOfObjectsRequired,argumentToTheConstructor);