title: passing vector to function c++
body: <p>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.</p>
  
  <pre><code>   //file: main.cpp
      int main(){
          vector &lt;Item *&gt; s;
           //loading my file and assign s[i]-&gt;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&lt;s.sizeof();i++){
              cout&lt;&lt; s[i]-&gt;name&lt;&lt;"  "&lt;&lt; s[i]-&gt;address&lt;&lt;endl;
          }
          return 0;
      }
  
  
  
      ---------------errors--------
      In file included from main.cpp:13:
      test.h:5: error: âstringâ does not name a type
      test.h:6: error: âstringâ does not name a type
      main.cpp: In function âint main()â:
      main.cpp:28: error: cannot convert âstd::vector&lt;Item*, std::allocator&lt;Item*&gt; &gt;â to âItem**â for argument â1â to âint tester(Item**)â
  </code></pre>