C Standard Libraries C++

wmemmove()

Declaration

wchar_t* wmemmove(wchar_t* wpDest,
                  const wchar_t* kwpSrc,
                  size_t uiCount);

Description

This function copies "uiCount" wide-characters from the buffer "kwpSrc" to the buffer "wpDest" and returns a pointer to "wpDest."

Example

#include <cwchar>

int main()
{
    wchar_t waBuffer1[] = L"Video Tutorials";
    wchar_t waBuffer2[] = L"XoaX.net";
    size_t uiCopySize = 5;

    wprintf(L"%u characters of \"%ws\" were copied to \"%ws\"\n",
        uiCopySize, waBuffer1, waBuffer2);
    // Copy the first 5 characters
    wmemmove(waBuffer1, waBuffer2, uiCopySize);
    wprintf(L"The Result is = \"%ws\"\n", waBuffer1);

    // Keep the window open until "Enter" is pressed
    getwchar();
    return 0;
}

Output

wmemmove() Output
 

© 2007–2022 XoaX.net LLC. All rights reserved.