Here's How :
#include "iostream"
class Arithmetic{
public:
int a;
Arithmetic(const int a) : a(a) {};
int Add(const Arithmetic&b) const{
return *this + b;
};
int Multiply(const Arithmetic&b) const {
return operator*(b);
};
int operator+(const Arithmetic& b) const {
return this->a + b.a;
};
int operator*(const Arithmetic& b) const {
return this->a * b.a;
};
};
int main(){
Arithmetic a(10);
Arithmetic b(12);
std::cout << a.Add(b) << std::endl;
std::cout << a.Multiply(b) << std::endl;
std::cout << a + b << std::endl;
std::cout << a * b << std::endl;
return EXIT_SUCCESS;
};
Here You can use the operators to directly operate between classes .