title: push_back a class object using vector.
body: <p>How to add object of class to vector in another class.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  class info{
      private: 
          int id;
          string name;
      public:
          info(int extId, string extName) {
              this-&gt;id = extId;
              this-&gt;name = extName;
          }
  };
  
  class db {
      private:
          vector&lt;info&gt; infoVector;
      public:
          void pushData(info * data) {
              this-&gt;infoVector.push_back(&amp;data);
          }
  };
  
  int main(){ 
      info * testData = new info(123, "nice"); 
  
      db database;
      database.pushData(testData);    
  
      return 0;
  }
  </code></pre>
  
  <p>I am creating a object of <code>info</code> class. The object contains one <code>int</code> and one <code>string</code> variables. Then I am creating <code>db</code> object and I am passing there a <code>testData</code> object. </p>
  
  <p>I got error message while building project. </p>
  
  <pre><code>main.cpp: In member function ‘void db::pushData(info*)’:
  main.cpp:23:44: error: no matching function for call to ‘std::vector&lt;info&gt;::push_back(info*&amp;)’
               this-&gt;infoVector.push_back(data);
                                              ^
  In file included from /usr/include/c++/5/vector:64:0,
                   from main.cpp:2:
  /usr/include/c++/5/bits/stl_vector.h:913:7: note: candidate: void std::vector&lt;_Tp, _Alloc&gt;::push_back(const value_type&amp;) [with _Tp = info; _Alloc = std::allocator&lt;info&gt;; std::vector&lt;_Tp, _Alloc&gt;::value_type = info]
         push_back(const value_type&amp; __x)
         ^
  /usr/include/c++/5/bits/stl_vector.h:913:7: note:   no known conversion for argument 1 from ‘info*’ to ‘const value_type&amp; {aka const info&amp;}’
  </code></pre>
  
  <p>What am I doing wrong?</p>