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

Recommended Answers

All 2 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.