Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » How to sort a vector?
How to sort a vector? [message #37842] Fri, 16 November 2012 22:41 Go to previous message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
I searched all over the forum and documentation and I used Visual Studio intellisense to help me, but I just cannot understand how I should sort a Vector. The Vector in this case is a Vector<MovieInfo>, which is a struct I wrote myself.

I found the different Sort functions but I simply don't understand how they work. I am used to using predicates, delegates and operators using C# to sort arrays and find values in one.

The problem is that I am using a Vector of items with an ArrayCtrl containing those items. I sorted the ArrayCtrl, which makes the indices different from the Vector. To sort my ArrayCtrl I simply used:

ArrayCtrl.Sort();


Which sorted alphabetically. I need to have the same for my Vector.
Can you help me?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Is libXi needed ??
Next Topic: To add serialize/xmlize/jsonize functions to EditField and others
Goto Forum:
  


Current Time: Sat Apr 27 16:46:17 CEST 2024

Total time taken to generate the page: 0.03548 seconds