memcpy()

memcpy()

Description

Copy bytes from one location to another.

Syntax

memcpy(dest[], source[], index, numbytes);

Parameters

Variable

Input

Variable

Input

dest

An array where the bytes from source will be copied in.

source

The source array.

index

Index of destarray. This index defines data copy start location in the dest array (bytes, not cells).

numbytes

Number of bytes (not cells) to copy.

Returns

Return value

Return explanation

SCRIPT_OPERATION_SUCCESS

Operation successful.

SCRIPT_OPERATION_FAILED

Operation failed.

Function call example

Example of changing memory location
new dest[10]; new source[5]; main() { memcpy(dest, source, 3, 2) while(1){ Delay(10000); } }