Function like C# Array.Copy() in the C language

c, c#

Solution

If you have an array like this:

SomeType myArray[50];

And you want to copy elements indexed 19-29 (the 20th through 30th elements).

Then you do:

memcpy(dest, &myArray[19], 10 * sizeof(SomeType));

Note: this code-segment makes no provision for initializing `myArray`, or allocating memory to `dest`

Problem

I'm looking for a C function similar to the C# Array.Copy(). I found memcpy() only, but I need to copy from specific index too.

Original source