What's the best way for me to sort strings? I'm using LPSTR.
What's the best way for me to sort strings? I'm using LPSTR.
Depends on why you are sorting them.
If it's because you need to have an order, but don't care which (so you can later search for them with a binary search) then lexicographical_compare or strcmp will be pretty similar in their results.
If it's to present them in order to a user then you need to sort them according to their culture's rules. You could use lexicographical_compare along with a locale-specific comparison object, or (since this is the Windows Programming section) you could go with the CompareString API.
http://www.unicode.org/reports/tr10/ is worth a read if you want to get deep into the details of rolling your own locale-specific comparisons.