6.23.60 wmemcpy Function
Copy wide characters to an object.
Attention: This function is implemented
only by MPLAB XC32 C compilers.
Include
<wchar.h>
Prototype
wchar_t * wmemcpy( wchar_t * restrict s1, const wchar_t * restrict s2,
size_t n);
Arguments
s1
- the object to hold the copied wide characters
s2
- the object from which wide characters are copied
n
- the number of wide characters to copy
Return Value
A copy of s1
.
Remarks
The function copies n
wide characters from the object pointed to by
s2
into the object pointed to by s1
.
Example
#include <wchar.h>
int main(void)
{
wchar_t ws[40];
wmemcpy(ws, L"a literal wide string", 10);
ws[10] = L'\0';
wprintf(L"the wide string copied to ws is \"%ls\"\n", ws);
}
Example Output
the wide string copied to ws is "a literal "