how could i use setter and getter for variable declared with vector and list .
class abc{
private:
vector<number> test;
list<numb> test2;
public:
void settest(const vector<number> &x){
test=x;
}
vector<number> gettest(){
return test;
}
void settest2(const list<numb> &y){
test2=y;
}
vector<numb> gettest2(){
return test2;
}
};
int main(){
abc object;
}
i tried to define set and get method for vector and list like above is it correct?please correct it. and how to call set and get function from main??.