#include #include using namespace std; void f(int i, int& r, int *p); int main() { int a {10}; int b {20}; int c {30}; //Obvious that the function could change the value of c, //but dangerously not obvious that the fuction could also change //the value of b. f(a, b, &c); cout << "a == " << a << "\n" << "b == " << b << "\n" << "c == " << c << "\n"; return EXIT_SUCCESS; } void f(int i, int& r, int *p) { ++i; //Increments i, but this has no effect on the value of a. ++r; //increments b. ++*p; //Increments c. cout << "i == " << i << "\n" << "r == " << r << "\n" //Output the value of b. << "*p == " << *p << "\n\n"; //Output the value of c. }