according to http://en.cppreference.com/w/cpp/string/byte/memcpy c++\'s memcpy takes three parameters: destination, source and size/bytes. it also returns a pointer
void *memcpy(void* dest, const void* src, std::size_t count);
//returns void * which can be assigned to another void array that can be used as int or char data type.
void *ret = new int[6];
ret = memcpy(newarr, arr, sizeof(int)* 5);