![]() |
How do I sort an array of cstrings?
I need to sort an array of cstrings in ascending order. the cstrings are names and i have to list them all in alphabetical order. The problem is I don't know how to determing which cstring comes first. Below is my code for sorting integers please let me know what to modify to sort cstrings in as much detail as you can. Thank you!
Code:
void swap(int& a, int& b) |
Re: How do I sort an array of cstrings?
like this
Code:
#include<stdio.h> |
Re: How do I sort an array of cstrings?
virxen, thank you very much for your reply! It was extremely helpful. The only thing I don't get is isn't a c-string a multi-dimensional array? if so, shouldnt we use the two brackets when doing the prototype as in void sort(char array[][SIZE]?
btw, I only use the include <iostream> & include <fstream> & using namespace std; |
Re: How do I sort an array of cstrings?
>>I need to sort an array of cstrings
Are you talking abot the CString c++ class that's in Microsoft's MFC library? Or are you talking about something else? (There is no such thing as standard c or C++ called cstring). |
| All times are GMT +5.5. The time now is 13:05. |