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

前端 未结 3 1509
梦谈多话
梦谈多话 2020-12-04 02:36

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

相关标签:
3条回答
  • 2020-12-04 03:04

    Nope, it's a non-standard extension. Unix-like systems commonly have a strcasecmp which performs the same task as MS's strcmpi.

    0 讨论(0)
  • 2020-12-04 03:12

    Nope, a quick CTRL+F in the standard returns nothing for strcmpi. This means that it is a non-standard extension (of which both Windows and GNU have a lot).

    0 讨论(0)
  • 2020-12-04 03:24

    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.

    0 讨论(0)
提交回复
热议问题