This is the same question asked in C# but i need for C++
How can I copy a part of an array to another array?
Consider I\'m having
int[] a = {
For simple C-style arrays you can use memcpy:
memcpy
memcpy(b, &a[1], sizeof(int) * 3);
This line copies sizeof(int) * 3 bytes (i.e. 12 bytes) from index 1 of a, with b as a destination.
sizeof(int) * 3
a
b