0

Hi All,

I have a class of type

class Row_Entry
{
public :
//CString symbol;
CString bid;
CString ask;
CString bid_size;
CString ask_size;
CString bmmid;
CString ammid;
CString type;
CString exch;
Row_Entry()
{
}
};

I am creating a vectorlike this
std::vector<Row_Entry>RAW_ENTRY;

Now i have pushed all my required data in the vector.Please tell me how to retrieve the data from the vector RAW_ENTRY where bid is in desending/ascending order?

Please help as its urgent...

Thanks..
Jyotis

Edited by happygeek: fixed formatting

3
Contributors
2
Replies
6
Views
9 Years
Discussion Span
Last Post by mahlerfive
0

You have to sort the elements based on their value of bid. Use any sorting algorithm you want. Bubble sort is fairly easy to code.

I assume you have a way to compare two bids that is satisfactory to you? I notices bid is type CString. If the CString represents a number, you may want to sort on the number itself rather than on the CString representation. Looking at the ASCII table, it may not matter, but it's something to think about.

Edited by happygeek: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.