Thread: Overloading ==

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728

    Overloading ==

    This is driving me nuts and I'm here at work without my books to help out. For some reason I thought that one didn't need to overload the "==" operator when comparing two objects of the same class but I get an error saying that it isn't defined with left hand operator of myclass. So I tried overloading the operator in the class but I must be doing something wrong because it just becomes circular. Here is what I have:
    Code:
    bool board::operator ==(board& b)
    {
    	return (*this==b);
    }
    I have a feeling its something real easy to fix but for the life of me I can't figure it out.
    Last edited by PJYelton; 01-02-2003 at 01:22 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  2. Homework help
    By mkdl750 in forum C Programming
    Replies: 45
    Last Post: 07-17-2008, 09:44 PM
  3. Separate long string into multiple arrays
    By cashmerelc in forum C Programming
    Replies: 6
    Last Post: 11-27-2007, 02:57 AM
  4. One quick question...
    By Kross7 in forum C++ Programming
    Replies: 10
    Last Post: 04-13-2007, 09:50 PM
  5. Is there a bug in this part of my algorithm for connect 4?
    By Nutshell in forum Game Programming
    Replies: 8
    Last Post: 04-28-2002, 01:58 AM