Code:
void * memmove ( void * destination, const void * source, size_t num ) {
char* buffer = new char [num];
memcpy((void*)buffer, source, num);
memcpy(destination, (void*)buffer, num);
delete[] buffer;
return destination;
}
1. Standard C functions should not use C++ functionality.
2. What if the user tries to copy 1GB of memory - you will most likely fail the new.
The normal memmove deterimens if the copy is overlapping, and if so, copies in a direction that avoids overwriting the data, otherwise just call memcpy() in the first place.
Also, your memcpy() is FAR from the optimal performance.
--
Mats