Polymorphism in C++ (part 2)
In the previous blog post, the definition,types and function overloading concepts are included. Here, is the link. https://rajeeva84.blogspot.com/2025/11/polymorphism-in-c.html in this post, operator overloading and run time polymorphism using virtual functions are explained. Operator overloading: This concept deals with operator. An operator can be overloaded with another definition. For example, “%” is used as two purposes. One is finding ‘ mod ’ functions and another one is ‘ percentage ’. Let us create a c++ program as follows. #include < iostream > using namespace std ; class ModIt { int m_value; public: ModIt(int v) : m_value(v) {} // let us Overload % operator ModIt operator%(const ModIt& x) const { ...