class fred { public: int foo( int x ) { int i; for ( i = 1; i <= 5; i += 1 ) { x += 1; } // for return x; } // foo }; class mary { fred f; public: int bar( int x ) { int r; x += 1; r = f.foo( x ); return r; } }; int main() { int r, x = 1; mary m; r = m.bar( x ); return 0; }