title: String vectors not passing to a class function
body: <p>I'm having some problems  with passing vectors, as parameters, to a  class function. Class is in another file. This is my code:</p>
  
  <p>main.cpp:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  
  #include "class1.h"
  
  using namespace std;
  
  int main() {
  
      vector&lt;string&gt; names;
  
      names.push_back("Bob");
      names.push_back("Gorge");
      names.push_back("Bill");
      names.push_back("Freddy");
      names.push_back("Daniel");
      names.push_back("Emily");
  
  
      class1 obj;
      obj.printVector(names);
  
      system("pause");
  }
  </code></pre>
  
  <p>class1.h:</p>
  
  <pre><code>#pragma once
  
  class class1
  {
  public:
      void printVector(std::vector&lt;string&gt;&amp; names);
  };
  </code></pre>
  
  <p>class1.cpp:</p>
  
  <pre><code>#include &lt;string&gt;
  
  #include "class1.h"
  
  using namespace std;
  
  void class1::printVector(vector&lt;string&gt;&amp; names) {
  
      for (unsigned int i = 0; i &lt; names.size(); i++)
      {
          cout &lt;&lt; names[i] &lt;&lt; endl;
      }
  }
  </code></pre>
  
  <p>I tried doing the same thing with other data types (int, char, floats...) and it worked. ALso when i just pass them to a function in main.cpp it works. The errors are:</p>
  
  <pre><code>- Severity  Code    Description Project File    Line    Suppression State
  Error   C3203   'allocator': unspecialized class template can't be used as a template argument for template parameter '_Alloc', expected a real type    tesst   c:\users\...\documents\programs and games\tesst\tesst\class1.h  6
  
  - Severity  Code    Description Project File    Line    Suppression State
  Error   C3203   'allocator': unspecialized class template can't be used as a template argument for template parameter '_Alloc', expected a real type    tesst   c:\users\...\documents\programs and games\tesst\tesst\class1.h  6
  
  - Severity  Code    Description Project File    Line    Suppression State
  Error   C2923   'std::vector': 'string' is not a valid template type argument for parameter '_Ty'   tesst   c:\users\...\documents\programs and games\tesst\tesst\class1.h  6   
  
  - Severity  Code    Description Project File    Line    Suppression State
  Error   C2923   'std::vector': 'string' is not a valid template type argument for parameter '_Ty'   tesst   c:\users\...\documents\programs and games\tesst\tesst\class1.h  6   
  
  - Severity  Code    Description Project File    Line    Suppression State
  Error   C2065   'string': undeclared identifier tesst   c:\users\...\documents\programs and games\tesst\tesst\class1.h  6   
  
  - Severity  Code    Description Project File    Line    Suppression State
  Error   C2065   'string': undeclared identifier tesst   c:\users\...\documents\programs and games\tesst\tesst\class1.h  6   
  
  - Severity  Code    Description Project File    Line    Suppression State
  Error   C2664   'void class1::printVector(std::vector &amp;)': cannot convert argument 1 from 'std::vector&lt;std::string,std::allocator&lt;_Ty&gt;&gt;' to 'std::vector &amp;' tesst   c:\users\...\documents\programs and games\tesst\tesst\main.cpp  22  
  
  - Severity  Code    Description Project File    Line    Suppression State
  Error   C2511   'void class1::printVector(std::vector&lt;std::string,std::allocator&lt;_Ty&gt;&gt; &amp;)': overloaded member function not found in 'class1'    tesst   c:\users\...\documents\programs and games\tesst\tesst\class1.cpp    9   
  </code></pre>
  
  <p>Please help!
  Thank You</p>