copying array using memcpy