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 = {
Yes, using st standard library algorithm copy:
copy
#include int main() { int array[5] = { 1,2,3,4,5 }; // note: no int[] array int *b = new int[3]; std::copy(array+1, array+4, b); // copies elements 1 (inclusive) to 4 (exclusive), ie. values 2,3,4 }