7

I was looking for this on internet and in every place with the functions of string.h these two are not mentioned.

Is because what? They aren't in every compiler?

4

3 に答える 3

14

これらは、Microsoft の C ライブラリの非標準関数です。_strlwr()MS は、名前が変更された関数とを支持して、それらを非推奨にしました_strupr()

MS のドキュメントでは、これらは POSIX 関数であると主張されていますが、私が知る限り、そうではありませんでした。

MS 以外のツールチェーンでそれらを使用する必要がある場合は、簡単に実装できます。

char* strlwr(char* s)
{
    char* tmp = s;

    for (;*tmp;++tmp) {
        *tmp = tolower((unsigned char) *tmp);
    }

    return s;
}
于 2014-10-12T17:43:23.563 に答える
4

These functions are not C standard functions. So it is implementation-defined whether they are supported or not.

于 2014-10-12T17:17:58.483 に答える
1

これらの関数は標準ではなく、実際には署名が壊れているか使用できません。大文字と小文字のマッピングでは長さが変わる可能性があるため、通常、文字列をその場で大文字と小文字を区別することはできません。

于 2014-10-12T17:47:10.743 に答える