Thread: Can someone explain this error?

  1. #1
    brianhj
    Guest

    Can someone explain this error?


  2. #2
    Registered User ski6ski's Avatar
    Join Date
    Aug 2001
    Posts
    133
    hmmm...... i have been getting hits on my firewall from home.houston.rr.com
    C++ Is Powerful
    I use C++
    There fore I am Powerful

  3. #3
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    sorry man, it's a very large image, try zipping it to make it easier to download

    Oskilian

  4. #4
    Registered User cody's Avatar
    Join Date
    Sep 2001
    Posts
    86

    :)

    Hi,

    well as the compiler error indicates, your class has no copy constructor, which could look like:

    Code:
    yourClass (const yourclass &c_roOther);

    bye
    cody
    #include "reallife.h"

  5. #5
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Your overload looks a little odd too. Typically an assignment operator overload looks like this...

    Xyz operator = (Xyz instance)

    ... although you should always be careful about returning classes from a function without specifying a copy constructor.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  6. #6
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Your assignment operator looks fine as long as it returns *this
    and copies your member variables.

    You need a copy constructor like this though:

    CLocation( const CLocation& other )
    {
    *this = other;
    }
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  2. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  3. Avoiding Global variables
    By csonx_p in forum Windows Programming
    Replies: 32
    Last Post: 05-19-2008, 12:17 AM
  4. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  5. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM