Tag: pass-by-value
-
If arrays are passed by reference why should i use int(&)[]
9 #include <iostream> using namespace std; void Change(int arr[3]) { for (int i = 0; i < 3; i++) { arr[i] = 1; } } int Test() { int arr[3] = { 0, 0, 0 }; for (int i = 0; i < 3; i++) { cout << arr[i] << endl; } Change(arr); for (int…