I’ve got Function1 where user inputs data in array1. I must make array2 in Function2 to be equal to array1 from Function1.
How do I “tell it” that it should use array1 from Function1?
I’ve tried
array2[50] = array1[50];
but of course that is not working.
You need to copy
array1elementwise intoarray2, e.g.You can also use
std::copyfrom thealgorithmheader.For both approaches you need to know the number of elements in
array1(array1_sizein the examples). Also,array2needs to be at least as big asarray1.