函式
<cwchar>

wcscat

wchar_t* wcscat (wchar_t* destination, const wchar_t* source);
連線寬字串
source 寬字串的副本追加到 destination 寬字串的末尾。destination 中的終止空寬字元會被 source 的第一個字元覆蓋,並且在 destination 中由兩者連線形成的新字串的末尾會包含一個空寬字元

destinationsource 不得重疊。

這是 strcat (<cstring>) 的寬字元等價版本。

引數

destination
指向目標陣列的指標,該陣列應包含一個 C 寬字串,並且足夠大以容納連線後的結果字串。
source
要追加的 C 寬字串。它不應與 destination 重疊。

返回值

返回 destination

示例

1
2
3
4
5
6
7
8
9
10
11
12
13
/* wcscat example */
#include <wchar.h>

int main ()
{
  wchar_t wcs[80];
  wcscpy (wcs,L"these ");
  wcscat (wcs,L"wide strings ");
  wcscat (wcs,L"are ");
  wcscat (wcs,L"concatenated.");
  wprintf (L"%ls\n",wcs);
  return 0;
}

輸出

these wide strings are concatenated. 


另見