memcpy

Copy byte buffer

Description

memcpy( dest[], source[], index, length )

Copy the source string to dest, starting at the index byte in dest, and counting length bytes.

Parameters

dest destination buffer
source string to be copied
index offset in source
length number of bytes to copy

Return value

Returns number of bytes copied.

Example usage

    new s1{20};
    new s2{20};
 
    strcopy(s1, "ABCdef");
    memcpy(s2, s1, 3, 3);    
 
    // s2 now contains "def" - NOTE that no terminating NULL character is copied