I want to create objects of a class with user defined size at run time. Like when user enter 5 it creates 5 objects. I tried this
student s[num];
for(int i=0;i<num;i++)
{
student s[i]; // also used student s[i]=new student();
}
but it says student s[num] expression must have constant value.
So how to do this?
std::vector<student> s(num);ArrayList.#include <vector>Tricky