Skip to content
ezeioDocs
  1. Reference
  2. Script reference
  3. Strings and buffers

memcpy

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

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

Last updated Nov 18, 2019