Write a C++ program to overload = = operator to check equality of two strings.
#include<iostream.h>
#include<conio.h>
#include<string.h>
class string
{
char str1[20];
public:
void get()
{
cout<<"Enter string:";
cin>>str1;
}
void operator = =(string s1)
{
int x;
x=strcmp(s1.str1,str1);
if(x= =0)
cout<<"Equal";
else
cout<<"Not equal";
}
};
void main()
{
clrscr();
string s,s1;
s.get();
s1.get();
s==s1;
getch();
}