how to copy or join subset of arrays

is there easy ways to copy a subset of array into a new array in arduino without using loop?

e.g. A[5]={1,2,3,4,5}; B[]; B[]=A[2-3];

would memcpy method work?


Yes, memcpy will work. Just make sure that your B array is big enough to hold the required number of bytes; it currently has a size of 0.

Yep, memcpy() .

Remember that B needs to have sufficient space to contain what you are copying into it.