Re: PLEASE - odd string sorting related problem
>Could some C guru provide some hints on my problem? I am trying to
It might if you STATE A PROBLEM.
>sort an array of character strings, where each string contains
>lowercase, uppercase, digits as well as non-alphanumeric characters as
>'-', '(' or '/'. Obviously, standard C functions as 'strcmp' would
>fail in these cases.
It is obvious to me that strcmp() would succeed in comparing any C
strings whatever, as long as you put no requirements on sort order
that conflict with what strcmp() does (and you didn't say anything
about sort order at all).
>I can convert all the non-digit characters to
>lowercase, but how do I deal with the non-alphanumeric characters?
It isn't necessary to convert punctuation to lower case in any
character set I'm aware of.
It is generally considered a hanging offense to deal characters
from the bottom of the deck.
|