The wmemcpy() function is specified in header file cwchar.h and copies a specified number of character from one string to the other. This function doesn’t check for any terminating null wide character in the first string called source it always copies exactly n characters to the second string called destination.
wchar_t* wmemcpy( wchar_t* destination, const wchar_t* source, size_t n )
Parameter : The function accepts three mandatory parameters which are described below:
- destination: specifies a pointer where the characters are to be copied .
- source: specifies a pointer where the data are present .
- n: specifies the number of characters to be copied .
Return value: The function returns the destination string.
Below programs illustrate the above function:
Program 1 :
Initial string -> geeks are for geeks Final string -> geeks are for
Program 2 :
Initial string -> GFG Final string -> GFG
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Function Overloading vs Function Overriding in C++
- How to call function within function in C or C++
- What happens when a virtual function is called inside a non-virtual function in C++
- Difference between Virtual function and Pure virtual function in C++
- div() function in C++
- log() function in C++
- exp() function C++
- arc function in C
- fma() function in C++
- scalbn() function in C++
- tolower() function in C
- wmemmove() function in c++
- localtime() function in C++
- toupper() function in C
- difftime() function in C++
- wcscat() function in C++
- wcsncpy() function in C++ with example
- imag() function in C++
- real() function in C++
- wcstok() function in C++ with example
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.