You need to make a compare function which compares 2 strings and use that as the last argument in qsort.
read more about the function here
http://www.cplusplus.com/reference/cstdlib/qsort/?kw=qsort
More Related Contents:
- Sorting (Quicksort) ,Partition
- Insertion sort stops working after million input
- How to implement classic sorting algorithms in modern C++?
- c++ sort keeping track of indices [duplicate]
- How can I sort a std::map first by value, then by key?
- The intersection of two sorted arrays
- `std::list::sort()` – why the sudden switch to top-down strategy?
- How can I sort an STL map by value?
- QuickSort and Hoare Partition
- Mixing two arrays by alternating elements two by two
- banker’s algorithm in c++
- What is the difference between palindrome permutation and permutation? [closed]
- how to show time performance for merge sort? [closed]
- What’s the most efficient way to erase duplicates and sort a vector?
- How to replace all occurrences of a character in string?
- Sorting a vector in descending order
- C++ Efficiently Calculating a Running Median [duplicate]
- Sorting a std::vector by the string?
- Finding nearest point in an efficient way
- Fast n choose k mod p for large n?
- Inverting a 4×4 matrix
- Print 2-D Array in clockwise expanding spiral from center
- Why would anyone use set instead of unordered_set?
- std::back_inserter for a std::set?
- Get a reverse iterator from a forward iterator without knowing the value type
- How to rotate a N x N matrix by 90 degrees? [closed]
- How to sort a linked list using bubble-sort?
- Is it possible to implement lock free map in C++
- Calculate mean and standard deviation from a vector of samples in C++ using Boost
- Checking if all elements of a vector are equal in C++