Monday, 19 May 2014

Overload logical or(||) operator

                Overload logical or(||) operator to print message on console screen


#include<conio.h>
#include<iostream>
using namespace std;
class A
{
int a,b;
public:
void get()
{
cout<<"\n enter value for a and b :";
cin>>a>>b;
}
void show()
{
cout<<"\na ="<<a<<" and b ="<<b<<endl;
}
void operator ||( char *s)
{
cout<<s;
}

};
int main()
{
A pout;
pout||"Welcome to the team \"Programming_Infinitum\"";
getch();
return 0;

}

No comments:

Post a Comment