title: how to use a vector from another class
body: <p>I have a class named <code>variable</code> which has</p>
  
  <pre><code>string name;
  double value;
  </code></pre>
  
  <p>and I have another class named <code>mainwindow</code> (by the way it is qt application.)
  in main window I have a vector 
  <code>vector&lt;variable&gt; vect</code>
  I want a class which <code>push_back</code> variable objects with using vect which is under main window 
  I wrote this but it gave me error</p>
  
  <pre><code>class add_variable
  {
  private:
    variable var;
    MainWindow &amp;vectholder;
  public:
    void push_back(var.getname(),var.getvalue());
  };
  </code></pre>
  
  <p>errors</p>
  
  <pre><code>error: 'var' is not a type
  error: expected ',' or '...' before '.' token
  </code></pre>
  
  <p>also I want to reach these variables which is pushed into vector
  I want to call them within another class </p>