Sorry I know there's lots of topics on this, i did internal search and was flooded, with hundred of pages. But my question will be brief and at least in my mind specific as I could not find the answer in the 20 odd posts I read after search.
On the page: http://www.cplusplus.com/reference/algorithm/sort/
it uses vectors, which I still have done little reading on yet. We haven't covered in class. the example uses: sort (myvector.begin(), myvector.end(), myobject);
so an alternate to this using arrays would be:
1 2 3 4
constint arraySize=1000;
string myArray[];
fillArray(myArray); // fills array with input file, 1 line = 1 string
sort (myArray[0], myArray[arraySize], myArray);
sort (myArray[0], myArray[arraySize], myArray)
Change subscripting with +, the last argument should be a comparison function sort (myArray, myArray+arraySize, SomeConversionFunction);
If it is an array of std::strings, you can omit the last argument and the default < operator would be used