memcpy with startIndex?

I always prefer the syntax

memcpy( &dst[dstIdx], &src[srcIdx], numElementsToCopy * sizeof( Element ) );

Just add the offset you want to the address of the buffer.

char abuff[100], bbuff[100];
....
memcpy( bbuff, abuff + 5, 10 );

This copies 10 bytes starting at abuff[5] to bbuff.


Just add the offset to the addresses. For example, if you wanted to copy the buffer starting with the Nth byte:

memcpy( destination, source + N, sourceLen - N );

This will copy to the destination. If you also want to offset the destination - add the offset to both:

memcpy( destination + N, source + N, sourceLen - N );