passing vector to function c++
问题 I have a main.cpp test.h and test.cpp> I am trying to pass my vector through so i can use it in test.cpp but i keep getting errors. //file: main.cpp int main(){ vector <Item *> s; //loading my file and assign s[i]->name and s[i]-address tester(s); } //file: test.h #ifndef TEST_H #define TEST_H struct Item{ string name; string address; }; #endif //file: test.cpp int tester(Item *s[]){ for (i=0; i<s.sizeof();i++){ cout<< s[i]->name<<" "<< s[i]->address<<endl; } return 0; } ---------------errors