+ 1

How to rewrite numbers from first array to second array?

24th Nov 2017, 7:52 PM
Irina
2 odpowiedzi
+ 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.
25th Nov 2017, 4:54 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 1
you mean transfer elements from array to another? for(i=0;I<array1.length;i++) {array2[I]=array1[I]}
24th Nov 2017, 7:55 PM
᠌᠌Code X
᠌᠌Code X - avatar