<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 庫函數 - wctomb() ## 描述 C 庫函數 **int wctomb(char *str, wchar_t wchar)** 把寬字符 **wchar** 轉換為它的多字節表示形式,并把它存儲在 **str** 指向的字符數組的開頭。 ## 聲明 下面是 wctomb() 函數的聲明。 ``` int wctomb(char *str, wchar_t wchar) ``` ## 參數 * **str** -- 一個指針,指向一個足以存儲多字節字符的數組。 * **wchar** -- 類型為 wchar_t 的寬字符。 ## 返回值 * 如果 str 不為 NULL,wctomb() 函數返回寫入字節數組中的字節數。如果 wchar 不能被表示為一個多字節序列,則會返回 -1。 * 如果 str 為 NULL,如果編碼具有移位狀態,則 wctomb() 函數返回非零,如果編碼是無狀態的,則返回零。 ## 實例 下面的實例演示了 wctomb() 函數的用法。 ``` #include <stdio.h> #include <stdlib.h> int main() { int i; wchar_t wc = L'a'; char *pmbnull = NULL; char *pmb = (char *)malloc(sizeof( char )); printf("要轉換的寬字符:\n"); i = wctomb( pmb, wc ); printf("被轉換的字符:%u\n", i); printf("多字節字符:%.1s\n", pmb); printf("當要轉換的字符為 NULL 時嘗試轉換:\n"); i = wctomb( pmbnull, wc ); printf("被轉換的字符:%u\n", i); /* 不會輸出任何值 */ printf("多字節字符:%.1s\n", pmbnull); return(0); } ``` 讓我們編譯并運行上面的程序,這將產生以下結果: ``` 要轉換的寬字符: 被轉換的字符:1 多字節字符:a 當要轉換的字符為 NULL 時嘗試轉換: 被轉換的字符:0 多字節字符: ```
                  <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>

                              哎呀哎呀视频在线观看