Having trouble trying to copy the vector 'sel' in main to vector 'ask' in class A.
Can someone either explain or show me?
Thanks in Advance!
class A{
private:
public:
vector<Trader> ask;
void AskMatchList(vector<Trader>&);
void showAuct();
};
void A::AskMatchList(vector<Trader> &list){
vector<Trader>::iterator it;
f1= new Trader; //I understand this is the WRONG WAY
f1->BidId; //but dont know the correct way.... :(
f1->TraderId;
f1->type;
f1->quantity;
f1->price;
}
void A::showAuct(){
vector<Trader>::iterator it;
for(it=ask.begin();it!=ask.end();++it){
it->showTrader();
}
}
int main(){
srand ( time(NULL) );
vector<Trader> sel;
vector<Trader> buy;
vector<Trader>::iterator it;
A auct;
int x = 0;
Trader* seller= new Trader[(NUMSELLER*NUMBIDS)];
Trader* buyer= new Trader[(NUMBUYER*NUMBIDS)];
//code to set the BidId,TraderId, Type, Quantity, Price
//for sel
auct.AskMatchList(sel);//Suppose to copy from vector<Trader> sel TO Auctioneer classes vector
auct.showAuct();
system("pause");
return 0;
}