# include
The class String
{public:
String () {
P=NULL;
}
String STR (char *);
Friend Boolean operator & gt; (String & amp; String1, String & amp; String2);
Friend Boolean operator=(String & amp; String1, String & amp; String2);
Friend Boolean operator & lt; (String & amp; String1, String & amp; String2);
Void the display ();
Private:
char *p;
};
String: : String STR (char *)
{
p=str;
}
Void String: : display ()
{
Cout}
Bool operator> (String & amp; String1, String & amp; String2)
{
If (STRCMP (string1. P, string2. P) & gt; 0)
return true;
The else
return false;
}
Bool operator<(String & amp; String1, String & amp; String2)
{
If (STRCMP (string1. P, string2. P) & lt; 0)
return true;
The else
return false;
}
Boolean operator==(String & amp; String1, String & amp; String2)
{
If (STRCMP (string1. P, string2. P)==0)
return true;
The else
return false;
}
Int main ()
{
String string1 (" Hello "), string2 (" Book "), string3 (" Computer ");
Cout<(string1 & gt; String2) & lt;
}
CodePudding user response:
Direct # include & lt; iostream>CodePudding user response:
C + + header files don't add. H