You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//one special thing about overloading () operator function is that,only this operator can take default arguments ,no other operator can take default arguments
class Marks {
public:
int mark;
Marks(int m) {
mark = m;
}
//operator function
Marks operator () (int m=20) {
cout<<"Operator function called"<<endl;
mark=m;
return *this; //this operator fuction returns the current address of the object