<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 `strrchr()`函數 > 原文: [https://beginnersbook.com/2017/11/c-strrchr-function/](https://beginnersbook.com/2017/11/c-strrchr-function/) **`strrchr()`函數**在給定字符串中搜索指定字符的最后一次出現。此函數與[函數`strchr()`](https://beginnersbook.com/2017/11/c-strchr-function/)完全相反,后者在字符串中搜索字符的第一次出現。 ## C `strrchr()`函數聲明 ```c char *strrchr(const char *str, int ch) ``` `str` - 搜索字符`ch`的字符串。 `ch` - 需要搜索的字符 ## `strrchr()`的返回值 它返回指向字符串中字符的最后一次出現的指針。這意味著如果我們顯示`strrchr()`的返回值,那么它應該顯示從指定字符的最后一次出現開始的字符串部分。 ## 示例:`strrchr()`函數 ```c #include <stdio.h> #include <string.h> int main () { const char str[] = "This-is-just-a-test-string"; const char ch = '-'; char *p, *p2; p = strrchr(str, ch); printf("String starting from last occurrence of %c is: %s\n", ch, p); p2 = strrchr(str, 'i'); printf("String starting from last occurrence of 'i' is: %s\n", p2); return 0; } ``` 輸出: ```c String starting from last occurrence of - is: -string String starting from last occurrence of 'i' is: ing ``` #### 相關文章: 1. [C - `strncpy()`示例](https://beginnersbook.com/2017/11/c-strncpy-function/) 2. [C - `strcpy()`示例](https://beginnersbook.com/2017/11/c-strcpy-function/) 3. [C - `strncmp()`示例](https://beginnersbook.com/2017/11/c-strncmp-function/) 4. [C - `strchr()`示例](https://beginnersbook.com/2017/11/c-strchr-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>

                              哎呀哎呀视频在线观看