Use a pointer trick to remove the memcpy .