C Standard Libraries C++

memmove()

Declaration

void* memmove(void* vpDest, const void* kvpSrc, size_t qCount);

Description

This function copies "qCount" bytes from the buffer "kvpSrc" to the buffer "vpDest." The function returns the pointer "vpDest." The "kvpSrc" and "vpDest" buffers may overlap.

Example

#include <cstdio>
#include <cstring>

int main()
{
    int iaSource[] = {3, 6, 9, 12, 15};
    int iaDest[10];

    // Copy the five entries of source
    memmove(iaDest, iaSource, 5*sizeof(int));

    for (int iIndex = 0; iIndex < 5; ++iIndex) {
        printf("%i  ", iaDest[iIndex]);
    }
    // Add an endline
    printf("\n");

    return 0;
}

Output

memmove() Output
 

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