wcscpy - C wchar.h

C examples for wchar.h:wcscpy

Type

function

From


<cwchar>
<wchar.h>

Description

Copy wide string

Prototype

wchar_t* wcscpy (wchar_t* destination, const wchar_t* source);

Parameters

Parameter Description
destination Pointer to the destination array where the content is to be copied.
source C wide string to be copied.

Return Value

destination is returned.

Demo Code

/* 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;
}

Related Tutorials