Jul 12, 2012 at 4:47pm UTC
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 UTC
Jul 12, 2012 at 4:59pm UTC
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 UTC
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 UTC
POSIX also has the function strncasecmp in <strings.h>.