I created one new class which is publicly inherited from the string class. I wish to overload the <
(less than) operator in the derived class. But from the overloaded function I need to call the parent class <
operator. What is the syntax for calling this function? I would like to implement the operator as a member function if possible.
In Java there is super
keyword for this.
My code is given below.
#include<iostream>
#include<string>
using namespace std;
class mystring:public string
{
bool operator<(const mystring ms)
{
//some stmt;
//some stmt;
//call the overloaded <( less than )operator in the string class and return the value
}
};