+ 1
if you assign an arr[] to arrr[] . The modified first array will also be equal to the arrr[]?
Can someone explain why the arrr[] will also be modified when modifying the arr[] even though the assigning of the array happened before the modifying the arr[] array? Ill link the code. https://code.sololearn.com/cDvrUEt6ZQ0f/?ref=app
1 ответ
+ 2
Assignment operation will not make a copy of arr. It will reference the arr. So if you change the arr you change the reference and change arrr.