Check out example codes for "copy smaller array into array cpp". It will help you in understanding the concepts better.

Code Example 1

unsigned char *a1 = arr1;
unsigned char *a2 = arr2;
for (int x = 0; x < 768; x++) //copy each row
{
    memcpy(a1, a2, nc);
    a1 += 1024;
    a2 += 768;
}

Learn ReactJs, React Native from akashmittal.com