// Week 3 Monday Lecture // Demonstration of passing by value in C #include void increment(int x); int main(void) { int x = 10; // passes the value 10 into the function increment(x); // x will still be 10 printf("Main: %d\n", x); return 0; } // Increments the local copy of x only! void increment(int x) { // This modifies the local copy of x x = x + 1; printf("Inc: %d\n", x); }