wmemmove() function in c++
The wmemmove() function is defined in cwchar.h header file. The wmemmove() function copies a specified number of wide characters from source to the destination.
Syntax:
wchar_t* wmemmove(wchar_t* dest, const wchar_t* src, size_t n);
Parameters: This method accepts the following parameters:
- dest: specifies the pointer to the destination array.
- src specifies the pointer to the source array.
- n: Number of wide characters to copy from src to dest.
Returns: The wmemmove() function returns the modified destination.
Below program illustrate the above function:-
Example:-
// c++ program to demonstrate // example of wmemmove() function. #include <bits/stdc++.h> using namespace std; int main() { // maximum length of the destination string wchar_t dest[30]; // maximum length of the source string wchar_t src[30]; // initialize the destination string wcscpy(dest, L"A computer science portal for geeks"); wprintf(L"Destination: %ls\n", dest); // initialize the source string wcscpy(src, L"geeksforgeeks"); wprintf(L"Source: %ls\n", src); wmemmove(dest+2, src+3, 5); wprintf(L"After modication, destinstion: %ls\n", dest); return 0; } |
chevron_right
filter_none
Output:
Destination: A computer science portal for geeks Source: geeksforgeeks After modication, destinstion: A ksforter science portal for gegeeksforgeeks
Recommended Posts:
- Function Overloading vs Function Overriding in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- log() function in C++
- exp() function C++
- fma() function in C++
- div() function in C++
- map upper_bound() function in C++ STL
- negate function in C++ STL
- map lower_bound() function in C++ STL
- scalbln() function in C++ STL
- map find() function in C++ STL
- map count() function in C++ STL
- map emplace_hint() function in C++ STL
- map erase() function in C++ STL
- set equal_range() function in C++ STL
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.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.



