函式
<cwchar>

wmemmove

wchar_t* wmemmove (wchar_t* destination, const wchar_t* source, size_t num);
移動寬字元塊
source 指向的位置的 num 個元素(型別為wchar_t)複製到 destination 指向的位置。複製時就好像使用了中間緩衝區,允許 destinationsource 重疊。

該函式不檢查 source 中任何終止的空寬字元——它總是精確複製 num 個元素(型別為wchar_t.

)。為了避免溢位,destinationsource 引數所指向的陣列的大小應至少為 num 個元素(型別為wchar_t.

)。這是 memmove<cstring>)的寬字元等效函式。

引數

destination
指向要複製內容的目標陣列的指標。
source
指向要複製資料的源的指標。
num
要複製的(型別為wchar_t)元素的數量。
size_t 是一個無符號整數型別。

返回值

返回 destination

示例

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

int main ()
{
  wchar_t wcs[] = L"wmemmove can be very useful......";
  wmemmove ( wcs+21, wcs+16, 11 );
  wprintf ( L"%ls\n", wcs );
  return 0;
}

輸出

wmemmove can be very very useful.


另見