// ptr4.cpp // Test program showing double indirection // with function calls. // 9/26/03, Ray S. Babcock // #include using namespace std; int fun1(int *); void proc2(int **); int main(void) { int i(10), j(0); cout << "Before fun1 i = " << i << ", j = " << j << endl; j = fun1(&i); cout << "After fun1 i = " << i << ", j = " << j << endl; } int fun1(int *iPtr) { int i; i = 15; (*iPtr)++; proc2(&iPtr); return(3); } void proc2(int **iPtrPtr) { int i; i = 12; **iPtrPtr += 3; return; }