#include<iostream.h>
#include<conio.h>
#include<string.h>
class string{
public:
char str[100];
string(char *);
int operator==(const string& s){
if(! strcmp(this->str,s.str))
return 1;
else
return 0;
}
};
string::string(char *s){
strcpy(str,s);
}
void main()
{
string str1("MCKVIE"),str2("MCKVIE");
clrscr();
if(str1==str2)
cout<<"A";
else
cout<<"B";
getch();
}
#include<conio.h>
#include<string.h>
class string{
public:
char str[100];
string(char *);
int operator==(const string& s){
if(! strcmp(this->str,s.str))
return 1;
else
return 0;
}
};
string::string(char *s){
strcpy(str,s);
}
void main()
{
string str1("MCKVIE"),str2("MCKVIE");
clrscr();
if(str1==str2)
cout<<"A";
else
cout<<"B";
getch();
}
No comments:
Post a Comment