title: how to pass vector objects from one class to another
body: <p>This is how I had tried sending the vector using one of the answers I got., but has not worked out yet.Should copy whn it gets to auctioneer.I want to display.</p>
  
  <pre><code>class Trader {   
  private:   
          int nextBidId; 
  
  public:   
  
          void loadRange( vector &lt;Bid&gt; &amp; bids ) {} ;
  
  class Simulator //Receives from the Trader,doent modify 
  { 
      vector &lt;Bid&gt; bids;
      Trader trader; 
      Auctioneer auctioneer; 
  
  public: 
      void run(); 
  }; 
  
  void Simulator::run() { 
      trader.loadRange(vector&lt;Bid&gt; &amp; bids);
      auctioneer.accept_bids(bid_vector::const_iterator begin, bid_vector::const_iterator end);
      auctioneer.displayBids();
  } 
  
  class Auctioneer // Has to receive from the simulator class 
  { 
  
  public: 
      vector &lt;Bid&gt; bids,v2;
      void accept_bids(vector&lt;Bid&gt; &amp; bids);
      void displayBids(){cout &lt;&lt; "\tBid\t(" &lt;&lt;  setw(3) &lt;&lt; bids.bidId &lt;&lt; "\t " &lt;&lt; setw(3) &lt;&lt; bids.trdId  &lt;&lt; "\t "  
                                            &lt;&lt; setw(3) &lt;&lt;  bids.type &lt;&lt;"\t " &lt;&lt; setw(3) &lt;&lt; bids.qty &lt;&lt;"\t "  &lt;&lt; setw(3) 
                                            &lt;&lt; bids.price &lt;&lt;")\t\n "  ;    }
  }; 
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have just copied a vector from another class, am now trying to see its contednts.its returning an error:</p>
  
  <p>Error: - begin has not been declared.how do I decalre bigin for the vector?</p>
  
  <pre><code>void Auctioneer::accept_bids(const BidList&amp; bid){ 
      vector&lt;Auctioneer&gt; *list;
      vector&lt;Auctioneer&gt;::iterator itr; // create an iterator
  
       for ( itr = list.begin();
       itr != list.end(); ++itr )
       cout &lt;&lt; *itr &lt;&lt; ' ';
  }
  </code></pre>