#include int main(int argc, char *argv[]) { int x, y; void f(int *, int *); // This declaration says that the // the parameters are of the type // "reference" to integer variables // The param passing mechanism used in // by VALUE !!! x = 10; y = 100; cout << "Address of x = " << (unsigned int) &x << ", address of y = " << (unsigned int) &y << "\n"; cout << "Before f(x,y), x = " << x << ", y = " << y << "\n\n"; f(&x, &y); // This passes the ADDRESS of x and y // by VALUE to f cout << "After f(x,y), x = " << x << ", y = " << y << "\n"; } void f(int* a, int* b) { cout << "Address of a = " << (unsigned int) &a << ", address of b = " << (unsigned int) &b << "\n"; cout << "Value of a = " << (unsigned int) a << ", value of b = " << (unsigned int) b << "\n"; cout << "Before increment *a = " << *a << ", *b = " << *b << "\n\n"; *a = *a + 10000; *b = *b + 10000; cout << "After increment *a = " << *a << ", *b = " << *b << "\n"; cout << "Value of a = " << (unsigned int) a << ", value of b = " << (unsigned int) b << "\n\n"; }