need some help here

1
2
3
AddStudent:
add a student to the array of students to a specified location in this array (i.e. takes the
student object and the array index as parameters).


how can i write it !!
As far as I know, you cannot change an array size at runtime. I think a vector<string> would be better suited for the job.

You'll probably need #include <vector> and using namespace std; (or use std::)

Initialise with vector<string> students;
Add to it with students.push_back(studentNameString);

Also try to learn about the .end() and .begin() vector functions. Try with this and see how far you can get.
Topic archived. No new replies allowed.