Sunday, August 7, 2011

Implementation of Unary operator overloading using friend function.


#include<iostream.h>
#include<conio.h>

class point
{
private:
int x,y;
public:
point(int i,int j)
{
x=i;
y=j;
}

void show()
{
cout<<"point="<<"("<<x<<","<<y<<")"<<endl;
}

friend void operator++(point &p1);

};

void operator++(point &p1)
{
p1.x++;
p1.y++;
}

void main()
{
clrscr();
point p1(2,2);
p1.show();
cout<<"after increment"<<endl;
++p1;
p1.show();
getch();
}


//for any errors pls comment......

28 comments:

  1. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information. Python Training in Chennai

    ReplyDelete
  2. This is the best explanation I have seen so far on the web. I was looking for a simple yet informative about this topic finally your site helped me a lot.
    Cloud Computing Courses in Chennai
    Cloud Computing Certification in Chennai
    Cloud Certification in Chennai
    Selenium Training in Chennai
    Selenium Training
    Selenium Course in Chennai

    ReplyDelete
  3. Thanks first of all for the useful info.
    the idea in this article is quite different and innovative please update more.
    german language training in bangalore
    German Training in Thirumangalam
    German Training in Nungambakkam

    ReplyDelete
  4. Hi,
    I must appreciate you for providing such a valuable content for us. This is one amazing piece of article. Helped a lot in increasing my knowledge.
    Web Designing Course in chennai
    PHP Training in Chennai
    web design training chennai
    web design training in chennai
    PHP Course in Chennai
    PHP Training Institute in Chennai

    ReplyDelete
  5. Great!it is really nice blog information.after a long time i have grow through such kind of ideas.thanks for share your thoughts with us.
    AWS Training Institutes in Vadapalani
    AWS Training in Thirumangalam
    AWS Certification Training in Bangalore
    AWS Certification Training

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Automated Forex Trading : exness login Is An Automated Forex Investing Software. It Is An Algorithmic Trading Software That Provides Automated Forex Trading Signals.

    ReplyDelete
  8. Trade FX At Home On Your PC: exness login Is A Forex Trading Company. The Company States That You Can Make On Average 80 – 300 Pips Per Trade.exness login States That It Is Simple And Easy To Get Started.

    ReplyDelete
  9. During a OctaFx Review workshop, each attendee will learn how to interpret market action using proven charting techniques, searching for reliable chart patterns and indicators to help them identify trading opportunities.

    ReplyDelete