/* wmemcpy example */
#include <wchar.h>
int main ()
{
wchar_t wcs1[] = L"To be or not to be";
wchar_t wcs2[40];
wchar_t wcs3[40];
wcsncpy ( wcs2, wcs1, 40 ); /* copies 19 characters, then fills with L'\0' */
wmemcpy ( wcs3, wcs1, 40 ); /* copies 40 characters */
wprintf (L"%ls\n%ls\n%ls\n",wcs1,wcs2,wcs3);
return 0;
}
|
To be or not to be To be or not to be To be or not to be |
| memcpy | 复制内存块(function ) |
| wmemmove | 移动宽字符块(function) |
| wmemset | 填充宽字符数组(function) |