6.23.36 wcscpy Function

Copy a wide string to an array.

Attention: This function is implemented only by MPLAB XC32 C compilers.

Include

<wchar.h>

Prototype

wchar_t * wcscpy( wchar_t * restrict s1, const wchar_t * restrict s2);

Arguments

s1
the array to hold the copied wide string
s2
the wide string to copy

Return Value

A copy of s1.

Remarks

The function copies the wide string pointed to by s2 into the array s1. The null wide character is copied.

Example

#include <wchar.h>

int main(void)
{
  wchar_t ws[40];

  wcscpy(ws, L"a literal wide string");
  wprintf(L"the wide string referenced by ws is \"%ls\"\n", ws);
}

Example Output

the wide string referenced by ws is "a literal wide string"