STL Vectors
Does anybody know how to make a vector using STL as a private variable member function of a class?
I am trying to make a vector of objects.
I used:
#include <vector>
...
private:
vector<Student> vect;
"a private variable member function"
I presume you mean "a private member variable".
What you have written there should work fine. I would do something like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#include <vector>
#include "Student.h"
// ...
class MtClass
{
private:
std::vector<Student> vect;
// ...
public:
// ...
};
|
Topic archived. No new replies allowed.