wmemmove -- Copy Wide-Character Strings

Format

#include <wchar.h>
wchar_t *wmemmove(wchar_t *s1, const wchar_t *s2, size_t n);

Language Level: ANSI 93
wmemmove copies n wide characters from the object pointed to by s2 to the object pointed to by s1. Copying takes place as if the n wide characters from the object pointed to by s2 are first copied into a temporary array, of n wide characters, that does not overlap the objects pointed to by s1 or s2. Then, wmemmove copies the n wide characters from the temporary array into the object pointed to by s1.

If n has the value 0, wmemmove copies 0 wide characters.

Return Value
wmemmove returns the value of >s1.

Example
This example copies the first five characters in a string to overlay the
last five characters in the same string. Note that because the string is only
nine characters long, the source and target overlap.

#include <wchar.h>
#include <stdio.h>
void main()
{
   wchar_t *theString = L"ABCDEFGHI";
   printf("\nThe original string: %ls \n", theString);
   wmemmove(theString+4, theString, 5);
   printf("\nThe string after wmemmove: %ls \n", theString);
   return;
   /********************************************************
      The output should be:
      The original string: ABCDEFGHI
      The string after wmemmove: ABCDABCDE
   ********************************************************/
}



memmove -- Copy Bytes
wmemchr -- Locate Wide Character in Wide-Character String
wmemcpy -- Copy Wide-Character Strings
wmemcmp -- Compare Wide-Character Strings
wmemset -- Set Wide Characters to Value
<wchar.h>