<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # C `strcoll()`函數 > 原文: [https://beginnersbook.com/2017/11/c-strcoll-function/](https://beginnersbook.com/2017/11/c-strcoll-function/) **`strcoll()`函數**類似于[`strcmp()`函數](https://beginnersbook.com/2017/11/c-strcmp-function/),它比較兩個字符串并根據比較結果返回一個整數。 ## C `strcoll()`聲明 ```c int strcoll(const char *str1, const char *str2) ``` `str1` - 第一個字符串 `str2` - 第二個字符串 ## `strcoll()`的返回值 * `> 0`:如果字符串`str1`中第一個不匹配字符的 ASCII 值大于`str2`。 * `< 0`:如果字符串`str1`中第一個不匹配字符的 ASCII 值小于`str2`。 * `= 0`:如果兩個字符串相等 ## C `strcoll()`函數示例 ```c #include <stdio.h> #include <string.h> int main () { char str1[20]; char str2[20]; int result; strcpy(str1, "HELLO"); strcpy(str2, "hello world!"); result = strcoll(str1, str2); if(result > 0) { printf("ASCII value of first unmatched character of str1 is greater than str2"); } else if(result < 0) { printf("ASCII value of first unmatched character of str1 is less than str2"); } else { printf("Both the strings str1 and str2 are equal"); } return 0; } ``` 輸出: ```c ASCII value of first unmatched character of str1 is less than str2 ``` 在這個例子中,我們比較兩個不同的字符串。`strcoll()`函數區分大小寫。 `'H'`的 ASCII 值小于`'h'`,這就是此函數返回負值的原因。 如果我們反轉`strcoll()`函數中的參數,讓我們說`strcoll(str2, str1)`,那么函數將返回一個正值。 #### 相關文章: 1. [C - `strcat()`函數](https://beginnersbook.com/2017/11/c-strcat-function-with-example/) 2. [C - `strchr()`函數](https://beginnersbook.com/2017/11/c-strchr-function/) 3. [C - `strncat()`函數](https://beginnersbook.com/2017/11/c-strncat-function/) 4. [C - `strncmp()`函數](https://beginnersbook.com/2017/11/c-strncmp-function/)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看