transfering a container of data to different classes
<p>I  am passing a vector of bids from Trader class to Simulator class.which class then passes it on to the auctioneer class.something seems messed up, can anyone spot it please.</p>

<p>Below is part of the code:
Error: 199 expected primary-expression before '&amp;' token </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;string&gt;
#include &lt;algorithm&gt;
#include &lt;cstdlib&gt;
#include &lt;iomanip&gt;

using namespace std;

const int NUMSELLER = 1;
const int NUMBUYER = 1;
const int NUMBIDS = 20;
const int MINQUANTITY = 1;
const int MAXQUANTITY = 30;
const int MINPRICE =100;
const int MAXPRICE = 150;
int s=0;
int trdId;

// Bid, simple container for values
struct Bid {
        int bidId, trdId, qty, price;
        char type;

        // for sort and find.
        bool operator&lt;(const Bid &amp;other) const { return price &lt; other.price; }
        bool operator==(int bidId) const { return this-&gt;bidId == bidId; }
};

// alias to the list, make type consistent
typedef vector&lt;Bid&gt; BidList;

// this class generates bids!
class Trader {
private:
        int nextBidId;

public:
        Trader();
        Bid getNextBid();
        Bid getNextBid(char type);

        void loadRange(BidList &amp;, int size); // generate a number of bids
        void loadRange(BidList &amp;, char type, int size);
        void submitBids();
};

Trader::Trader() : nextBidId(1) {}

#define RAND_RANGE(min, max) ((rand() % (max-min+1)) + min)

Bid Trader::getNextBid() {
        char type = RAND_RANGE('A','B');
        return getNextBid(type);
}

Bid Trader::getNextBid(char type) {
        for(int i = 0; i &lt; NUMSELLER+NUMBUYER; i++)
     {
        if (s&lt;10){trdId=0;type='A';}
        else {trdId=1;type='B';}
        s++;
        int qty = RAND_RANGE(MINQUANTITY, MAXQUANTITY);
        int price = RAND_RANGE(MINPRICE, MAXPRICE);
        Bid bid = {nextBidId++, trdId, qty, price, type};
        return bid;
}
}
void Trader::loadRange(BidList &amp;list, int size) {
        for (int i=0; i&lt;size; i++) { list.push_back(getNextBid()); }
}

void Trader::loadRange(BidList &amp;list, char type, int size) {
        for (int i=0; i&lt;size; i++) { list.push_back(getNextBid(type)); }
}

bool compareBidList(Bid one, Bid two) {

        if (one.type == 'A' &amp;&amp; two.type == 'B')
                return (one.price &lt; two.price);

        return false;
}

void sort(BidList &amp;bidlist) { sort(bidlist.begin(), bidlist.end(), compareBidList); }
//-----------------------------------------------------------------

//To go through the bidlist (after sorting) in reverse direction.
//If the first entry  found  is an "A", ignore it
//Look for the first "A" to match it, and so on..........
//If "B" quantity is greater than the matching "A" quantity, copy the "A"
//To matchedBids, copy the "B" to matchedBids but with  reduced quantity equal to the "A"
//REPLACE the "B" in the original vector with an NEW "B"


//---------------------------AUCTIONEER-------------------------------------------

class Auctioneer {

public:

Auctioneer (const BidList&amp; vec);   // copy constructor

typedef vector&lt;Auctioneer&gt; vec;
typedef vector&lt;Auctioneer&gt; buyers;
typedef vector&lt;Auctioneer&gt; sellers;
typedef Auctioneer* iterator;
typedef const Auctioneer* const_iterator;
//typedef size;
typedef Auctioneer value_type;

vector&lt;Bid&gt; list;
//typedef vector&lt;Bid&gt; BidList;
//typedef vector&lt;Bid&gt; iterator = BidList;

void accept_bids(vector&lt;Bid&gt; lst) {list = lst;}
void storeBids(){copy(list.begin(), list.end(),
                 bids.begin());}
void displayBids(){cout &lt;&lt; "Ok the bids" &lt;&lt; endl;} ;

void matchBid();
void calculateProfit();
vector&lt;Auctioneer&gt;::const_iterator b, e;
// new functions to return iterators
iterator begin() { return data; }
const_iterator begin() const { return data; }

iterator end() { return limit; }
const_iterator end() const { return limit; }

private:
string bids;
iterator data;
iterator limit;

};
//---------------------------------SIMULATOR-------------------------------------------
class Simulator {
    Trader trader;
    Auctioneer auctioneer;
    //SmartTrader  strader;

public:
   vector&lt;Bid&gt; list;
   char type;

   void run();
};

void Simulator::run()
    {
      trader.loadRange(BidList &amp;list); //calling from Base class
      auctioneer.receiveBids(list);//receiver
      auctioneer.displayBids;    // print from receiver
    }

//Simulator::accept_bids(bid_vector::const_iterator begin, bid_vector::const_iterator end))


int main() {
       // Trader Trader;
//        BidList bidlist;
         Auctioneer auctioneer;

        auctioneer.loadRange(bidlist, NUMBIDS);
        show("Bids before sort:", bidlist);
        sort(bidlist);
        show("Bids after sort:", bidlist);

        //count(bidlist);

        //unpair(bidlist);
        //unpair("Bids after sort:", bidlist);

        searchTest(bidlist, 3);
        searchTest(bidlist, 33);
         system("pause");
        return 0;
}
</code></pre>
