function
<cwchar>
wmemmove
wchar_t* wmemmove (wchar_t* destination, const wchar_t* source, size_t num);
Move block of wide characters
Copies the values of num elements of type wchar_t from the location pointed by source to the location pointed by destination. Copying takes place as if an intermediate buffer were used, allowing the destination and source to overlap.
The function does not check for any terminating null wide character in source - it always copies exactly num elements of type wchar_t.
To avoid overflows, the size of the arrays pointed by both the destination and source parameters, shall be at least num elements of type wchar_t.
This is the wide character equivalent of memmove (<cstring>).
Parameters
- destination
- Pointer to the destination array where the content is to be copied.
- source
- Pointer to the source of data to be copied.
- num
- Number of elements of type wchar_t to copy.
size_t is an unsigned integral type.
Return Value
destination is returned.
Example
1 2 3 4 5 6 7 8 9 10
|
/* wmemmove example */
#include <wchar.h>
int main ()
{
wchar_t wcs[] = L"wmemmove can be very useful......";
wmemmove ( wcs+21, wcs+16, 11 );
wprintf ( L"%ls\n", wcs );
return 0;
}
| |
Output:
wmemmove can be very very useful.
|
See also
- memmove
- Move block of memory (function
)
- wmemcpy
- Copy block of wide characters (function
)
- wmemcmp
- Compare two blocks of wide characters (function
)
- wmemset
- Fill array of wide characters (function
)
- wcsncpy
- Copy characters from wide string (function
)