Thread: push_front method for class List

  1. #16
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    Why are you dereferencing `this'?

    Your copy constructor doesn't create a unique copy.
    Your `push_back' is incomplete or needs a boost I'm not seeing from other code.
    Your destructor always destroys partially shared data.
    Your `pop_front' is horribly broken.

    As for your question, what is "money"?

    Soma

  2. #17
    Registered User CASHOUT's Avatar
    Join Date
    Jul 2011
    Location
    Florida
    Posts
    88
    Quote Originally Posted by Elysia View Post
    The copy constructor is still wrong. You need to go back to basics and think about what you have to do to copy a list.
    Remember that the copy must be independent of the original list. Whatever changes you make to the copy will not reflect in the original!
    Okay I will. I appreciate your patience.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Passing Class object to the same class method
    By infantheartlyje in forum C++ Programming
    Replies: 5
    Last Post: 10-30-2011, 06:51 AM
  2. call a method from another to a class
    By vipur in forum Tech Board
    Replies: 7
    Last Post: 11-15-2009, 08:39 AM
  3. calling a class method within different class method
    By alyeska in forum C++ Programming
    Replies: 5
    Last Post: 03-08-2009, 10:56 AM
  4. Why can't this method take derived class?
    By 6tr6tr in forum C++ Programming
    Replies: 61
    Last Post: 04-30-2008, 07:00 AM
  5. class method
    By dayknight in forum C++ Programming
    Replies: 5
    Last Post: 04-11-2004, 04:55 PM