Why? If you don't care about the last characters, why would you bother if
also that part got sortet correctly instead of in some arbitary order?
> I would want to sort an array full of names like that by just the first
> whatever characters, in this case, 9.
To compare two complete strings the correct way you would probably use
strcmp. To only compare up to 9 characters you could instead use strncmp,
but again, why?
In most cases when comparing a lot of strings strncmp will probably be
slower than strcmp. What would the gain be to maybe get a little
randomness in the result instead of a total predictable result?
regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc3(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost