Introduction
This article discusses Implementation of wmemmove() method in C++. The wmemmove() function is defined in cwchar.h header file. The wmemmove() method copies a set of wide characters from one location to another. The <cwchar> header file contains the wmemmove() method.
There is a popular quote “Don’t talk, just show me the code!!” abiding by the words let see the implementation of wmemmove() in c++.
Also see, Literals in C, Fibonacci Series in C++
BreakDown of wmemmove() method
The section discusses the detail breakdown of the wmemmove() method in C++. It includes discussion of declaring the prototype, parameters of wmemmove() and return value of the wmemmove() method.
Prototype declaration wmemmove()
wchar_t* wmemmove( wchar_t* dest, const wchar_t* src, size_t count);
Three parameters are sent to the wmemmove() function: dest, src, and count. When the wmemmove() function is invoked, it copies count wide characters from the src memory location to the dest memory address.
Even if the source and dest pointers overlap, copying is done. This is due to the creation of an intermediate buffer where the data is first transferred from src and then copied to dest.
If count is 0, this function has no effect.
Parameters of wmemmove()
src: Pointer to the wide character array from which the contents are copied.
dest: Pointer to the wide character array from which the contents are copied
count: The number of wide characters to copy from the source to the destination.
Return value of wmemmove()
The wmemmove() function returns the dest pointer.
Also Read - C++ Interview Questions