case insensitive strncmp?

Jul 12, 2012 at 4:47pm
Hi,

I'd like to know if a case insensitive strncmp function exists.
Thanks for your help!

Sky
Last edited on Jul 12, 2012 at 4:47pm
Jul 12, 2012 at 4:59pm
Not as standard, I believe, but there are many non-standard implementations.

See if your system comes with strcasecmp (from strings.h, common on *nix), strnicmp, stricmp (no idea where they live).

If you don't have one, you'll have to make it yourself.
Jul 12, 2012 at 5:03pm
I've tried that, but nope I don't have it. Plus there is no comparison of a certain nb of characters as in strncmp, which is really cool for char arrays...
Jul 12, 2012 at 5:31pm
POSIX also has the function strncasecmp in <strings.h>.
Topic archived. No new replies allowed.