If I had a class foo then
class foo{
vector <int> vec;
int someint;
public:
foo(number n): someint(n){}
}
How would I write a constructor for the vector, for class foo? Moreoever, I can use:
int get_someint() const{
return someint;
}
To return an int, but what about vectors?
When working with complex data types, its usually best to work with references, or const-references like so:
Example usage: