Using function overloading in c++