I suspect you're trying to copy the data in one array into another array. However, what that statement says is that you want to redirect the pointer. which is definitely wrong in this case (not just the type conversion---you'd lose the malloced memory too).

Try using std::copy.