Vectors - accessing an unknown amount of objects
In basic form I have a class called students which make student objects with an instance variable called mark.
Theres a question I have thats confusing me. It says that a method will take in a vector as its parameter of student objects. The requirements of the question are then for how many objects there are in the vector (The number of student objects in the vector will be random) that the mark of these students would be displayed. So for example if theres three student objects with marks 20,30,40. These values will be printed out like, "20 30 40"
I understand that I can simply find out the size of the vector with int vecSize=vectorName.size();
But what confuses me is after this how on earth will I be able to retrieve all of these objects as the size of the vector is unknown and number of objects in that vector are unknown?
Any examples or explainations of the best way of doing this are much appreciated.