I have two postcodes char*
that I want to compare, ignoring case.
Is there a function to do this?
Or do I have to loop through each use the tolower func
You can get an idea, how to implement an efficient one, if you don't have any in the library, from here
It use a table for all 256 chars.
then we just need to traverse a strings and compare our table cells for a given chars:
const char *cm = charmap,
*us1 = (const char *)s1,
*us2 = (const char *)s2;
while (cm[*us1] == cm[*us2++])
if (*us1++ == '\0')
return (0);
return (cm[*us1] - cm[*--us2]);