memcpy

 

Description

Copy characters between buffers.

Syntax

LPVOID memcpy( LPVOID lpDestination, const LPVOID lpSource, size_t uSize )

Parameters

lpDestination
[modify] New buffer
lpSource
[input] Buffer to copy from
uSize
[input] Number of characters to copy

Return

The value of lpDestination.

Examples

EX1

void memcpy_ex1()
{
    int aa, bb;    
    memset(&aa, 5, sizeof(int));    // Set every byte of aa to 5.
    printf("aa is %x \n",aa);
    memset(&bb, 0, sizeof(int));    // Set every byte of bb to 0.
    memcpy(&aa, &bb, sizeof(int));  // Now every byte of aa is 0 too.
    printf("now aa is %x \n",aa);
}

Remark

Copy characters between buffers.

See Also

header to Include

origin.h

Reference