I have two functions that do the same thing: they add two numbers. One adds two numbers which are members of the class, the other adds numbers given by the user, outside the class.

Is there any way to write one single function that adds two numbers and checks whether the arguments are user input or class members?

```
void myclass::add(){
cout<<this->a+this->b;
}

void myclass::add(int a,int b){
cout<<a+b;
}

```