Posted by : ANIMESH SHAW Thursday, 15 March 2012





The equality operator will work on pointers regardless of whether you've implemented the equality operator for your class. If it's giving an error when used with pointers, then you're doing something wrong.

To define the equality operator as part of your class:


Code:

class test
{
   public:
   bool operator==(const test &t); // in this method, see if t is equal to *this.
}

One Response so far.

  1. Anonymous says:

    Oh my goodness! Awesome article dude! Many thanks, However I am having troubles with your RSS.

    I don't know why I can't subscribe to it. Is there anybody having identical RSS problems?
    Anybody who knows the answer will you kindly respond? Thanx!

    !
    Also visit my blog ; how to lose weight quick

Popular Post

Total Pageviews

Sign In

Follow by Email

Powered by Blogger.

Like Us on Facebook

Search This Blog

Loading...

Indian Coder

- Copyright © Programming Mania -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -