Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the function strcmpi in the C standard libary of ISO?

Tags:

c

linux

windows

I noticed that the difference between linux and windows. strcmpi is in windows C standard libary implementation but it is not in GNU's C standard libary implementation. Is the function strcmpi in the C standard libary defined by ISO? How can I get the standard file? Thank you.

like image 500
JACK M Avatar asked Dec 22 '22 01:12

JACK M


1 Answers

The POSIX Standard (aka, UNIX) has strcasecmp() but it's not part of C99 / ISO-C.

Note: If you compare the above reference with e.g. the one for strcmp() you'll note that the latter explicitly references ISO-C, while the former does not. An useful feature of the OpenGroup references.

Edit: Since the locale-dependency was mentioned as a complication, see the above reference for strcasecmp_l() which allows explicitly specifying the locale to be used for the conversion. Windows has _strcmpi_l() for the purpose, again keeping with its own naming conventions.

like image 142
FrankH. Avatar answered Dec 24 '22 00:12

FrankH.