-
December 14th, 2008, 04:58 PM
#1
Quick Sort Structs
Hey i am new to c plus plus, and really need some help!
Basically i have information, in a file, first name, second name and idnumber stored in a struct for a number of people as such:
struct person {
char idnumber [numbersize];
char firstname [namesize];
char secondname [namesize];
};
And i need to be able to sort it according to either first name, second name or in ascending idnumber using a quick sort. Is it possible to write a general function and use pointers to assign the relevant piece of information to sort by e.g first name etc?. Then, is it possible to call the function and print the sorted list?
If someone could show me how to do this or offer some helpful code or some hints it would be greatly appreciated.
Thanks.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|