Question : copy smaller array into array cpp
Answered by : naughty-newt-3fdwlifsl3v6
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;
}
Source : https://stackoverflow.com/questions/3746811/copy-smaller-array-into-larger-array | Last Update : Mon, 12 Oct 20