The problem with using an array is that it is fixed in size. If your students class has a dynamic array, then the array has to be created to a given size.
Once you do that, you have to keep track of how many student objects are in the array. AND when the array fills up, you have to create a bigger array and copy the old array to the new array and then delete the old array.
Pant. Pant. Pant.
C++ implements a container called vector that implements your array and keeps track of all that stuff about how many students are in the array and to expand the array if needed.
All you have to do is create a student and add it to the vector:
-
student s(...all of the constructor arguments...);
-
-
vector<student> students;
-
-
students.push_back(s);
-
-
and you are done.
If you have to use your own array, be prepared for substantial code that essentially duplicates the code for the vector.