New Sort an Array of Classes
I am new to C++. I am look for the best way to sort a structure or class array. (I hope I am using the right terms
I have a || array of 5 items with name=(john, jim, danny, spencer, greg)
They have tuition = (10., 12, 11, 14, 18)
I would like to change this to a class and be able to sort on either tuition or names.
What is the best way to do this in c++
I can do a sort, but need to sort a array of classes
Thanks for the help, but what I need is an example of how to sort a class array or structure array.
The only way I seem to get it to work is by using || arrays. Treating both name and tuition as seperate arrays, and doing multiple swaps. I cannot see a way to use vectors. This can be very cumbersome for a large class or structure with many items.
Is there one exaample out there of sorting a array sturcture? All I seem to find is single items.
I think I need to start new tread.
I believe I do not understand the releationship of vectors and class arrays. I will start a new tread so I can start get back to this one when I have a couple basics