![]() |
|
#1
|
|||
|
|||
Help: selection sort algorithm -- alphabeticalBelow is the code I've written to sort each separate goals/assists/shots array in ascending order, the problem I'm having is that I don't know how to sort the string of names in alphabetical order using the selection sort algorithm.
I'm not asking for a solution, just wondering if I can approach the string array the same as I would an int array, and if not, how I would possibly retrieve the first letter of each string array element and compare it with the rest? Thanks in advance CPP / C++ / C Code:
Last edited by LuciWiz : 27-Oct-2009 at 16:58.
Reason: Please insert your C++ code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: Help: selection sort algorithm -- alphabeticalThere are a lot of very useful tools in the string class. cplusplus.com/reference/string/string/
One of them you might be interested in is the [ ] operator. CPP / C++ / C Code:
Code:
|
|
#3
|
|||
|
|||
Re: Help: selection sort algorithm -- alphabeticalThanks, but I figured it out,
I just used the same code in my selection sort algorithm for the integers for the strings, and it worked out just fine. |
Recent GIDBlog
Accepted for Ph.D. program by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Selection Sort | nurulshidanoni | C++ Forum | 2 | 06-May-2008 05:39 |
| Quick Sort Algorithm | Peter_APIIT | C++ Forum | 3 | 03-Oct-2007 23:45 |
| linked lists selection and insertion sort | iceman2006 | C++ Forum | 1 | 27-Jun-2006 08:29 |
| Merge Sort Algorithm .c | eclipt | C Programming Language | 1 | 28-Dec-2005 03:56 |
| Selection Sorting--Help Urgently Needed | TetrahedreX | C Programming Language | 2 | 03-May-2005 11:57 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The