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.
The below program illustrate the above function:-
Example:-
C++14
#include <bits/stdc++.h>
using namespace std;
int main()
{
wchar_t * dest_buf=L"A computer
science portal for geeks";
wchar_t dest[wcslen(dest_buf)+1];
wchar_t * src_buf=L "geeksforgeeks" ;
wchar_t src[wcslen(src_buf)+1];
wcscpy(dest,dest_buf);
wprintf(L "Destination: %ls\n" , dest);
wcscpy(src,src_buf );
wprintf(L "Source: %ls\n" , src);
wmemmove(dest+2, src+3, 5);
wprintf(L"After modification, destination:
%ls\n", dest);
return 0;
}
|
Output:
Destination: A computer science portal for geeks
Source: geeksforgeeks
After modication, destinstion: A ksforter science portal for geeks
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
23 Sep, 2022
Like Article
Save Article