// C++ program to illustrate the begin and end iterator #include #include #include using namespace std; class functor1 { public: void operator()( int& x1 ) { cout << "Inside operator() : " << x1 << endl ; x1++ ; } }; void function1( int& x1 ) { cout << "Inside function1() : " << x1 << endl ; x1++ ; } int main() { functor1 functor1Object ; int y1 = 10 ; functor1Object( y1 ) ; cout << "y1: " << y1 << endl ; function1( y1 ) ; cout << "y1: " << y1 << endl ; return 0; }