+ 1
How to rewrite numbers from first array to second array?
2 Answers
+ 4
Even easier method, if you are on a newer compiler :
#include<algorithm>
int main()
{
int a1[5],a2[5];
std::copy(a1,a1+5,a2);
for( int i : a2 ) cout<<i;
}
Note that a2 must have a size that can hold the number of elements specified for copying.
+ 1
you mean transfer elements from array to another?
for(i=0;I<array1.length;i++)
{array2[I]=array1[I]}