C examples for wchar.h:wcscpy
function
<cwchar> <wchar.h>
Copy wide string
wchar_t* wcscpy (wchar_t* destination, const wchar_t* source);
Parameter | Description |
---|---|
destination | Pointer to the destination array where the content is to be copied. |
source | C wide string to be copied. |
destination is returned.
/* wcscpy example */ #include <wchar.h> int main ()//from w ww . j a va 2s . com { wchar_t wcs1[]=L"this is a Sample string"; wchar_t wcs2[40]; wchar_t wcs3[40]; wcscpy (wcs2,wcs1); wcscpy (wcs3,L"copy successful"); wprintf (L"str1: %ls\nstr2: %ls\nstr3: %ls\n",wcs1,wcs2,wcs3); return 0; }