#include<iostream.h>
#include<conio.h>
//THE OPERATORS {DOT OPERATOR (.), SCOPE RESOLUTION OPERATOR(::), CONDITIONAL OPERATOR(?:), POINTER TO MEMBER
//OPERATOR(->)} CAN NOT BE OVERLOADED NEITHER A NEW CREATED OPERATOR(ie *&) CAN BE OVERLOADED
class count
{
private:
int n;
public:
count()
{
n=0;
}
void show()
{
cout<<"n= "<<n<<endl;
}
void operator ++ ()
{
n=n+1;
}
};
void main()
{
count c;
c.show();
c++; //or ++c
c.show();
getch();
}
#include<conio.h>
//THE OPERATORS {DOT OPERATOR (.), SCOPE RESOLUTION OPERATOR(::), CONDITIONAL OPERATOR(?:), POINTER TO MEMBER
//OPERATOR(->)} CAN NOT BE OVERLOADED NEITHER A NEW CREATED OPERATOR(ie *&) CAN BE OVERLOADED
class count
{
private:
int n;
public:
count()
{
n=0;
}
void show()
{
cout<<"n= "<<n<<endl;
}
void operator ++ ()
{
n=n+1;
}
};
void main()
{
count c;
c.show();
c++; //or ++c
c.show();
getch();
}
Thanks for shairng c+++ links see latest cells here:
ReplyDeletehttp://www.mobile-phone.pk/latest_mobiles/