title: passing vector from one class to other as object
body: <p>I have two classes <code>Net</code> and <code>GA</code> and I want to pass a vector from <code>GA</code> to <code>Net</code>  through <code>main</code>. Consider the following code.</p>
  
  <pre><code>class GA {
      inline vector &lt;double&gt; get_chromosome(int i) { 
          return population[i]; 
      }
  }
  
  class Net {
      int counter;
      Net::setWeights(vector &lt;double&gt; &amp;wts){
          inpHidd = wts[counter];
      }
  }
  
  main(){
      net.setWeights( g.get_chromosome(chromo) );
  }
  </code></pre>
  
  <p>Error is:</p>
  
  <pre><code>Network.h:43:8: note: void Network::setWeights(std::vector&lt;double&gt;&amp;)
     void setWeights ( vector &lt;double&gt; &amp;wts );
          ^
  Network.h:43:8: note:   no known conversion for argument 1 from ‘std::vector&lt;double&gt;’ to ‘std::vector&lt;double&gt;&amp;’
  </code></pre>
  
  <p>Any Idea?</p>