Hello guys,
My problem is that my code will automatically go through:
if((ask[i].getPrice()) <= (buy[j].getPrice())){
where ask and buy are vectors.
I need to know how I am suppose to compare them based upon the getPrice()......
Thanks in Advanced.
The rest of the code is here:
int i=(int)ask.size();
int j=(int)buy.size();
while(!buy.empty()){
if((ask[i].getPrice()) <= (buy[j].getPrice())){//SUPPOSE to only allow through IF the prices are the same or less. BUT it goes straight through anyway...
matchedAsk.insert(matchedAsk.end(),ask.end(), ask.end()+1);
matchedBuy.insert(matchedBuy.end(),buy.end(), buy.end()+1);
ask.pop_back();
buy.pop_back();
}else {
unmatchedAsk.insert(unmatchedAsk.end(),ask.end(),ask.end()+1);
ask.pop_back();
i--;
}
}