// // Example 3.4. Demonstration of how a function cannot change // the contents of a pass by value parameter // #include using namespace std; int main() { void modifyI(int i); // prototype local to main int i; // local to main i = 1; // local variable is assigned 1 cout << "Before calling modifyI, i equals " << i << endl; modifyI(i); cout << "After calling modifyI, i equals " << i << endl; return 0; } // // Function with local variable i // Pre: none // Post: Local variable i is assigned 3. // void modifyI() { int i; // local to modifyI i = 3; // local i is assigned 3 }