I was told that template copy constructors was a no no(not that I cant use one but its a bad practice to do so).
It isn't bad practice. If you wish to support value/copy semantics and your class is managing its own memory, it is necessary or you end up destroying objects multiple times.
I haven't checked your code to see if there is use of the copy assignment operator, but I wouldn't surprised if there was one. You'll probably need to supply that too.
Also I'm not sure where exactly I would use it. Should I copy the CD temp before I pass it to the CDList.insertNode()?
LinkList::insertNode takes it's argument by value. The compiler is already making a copy when you call it. It just happens to be using the inadequate defaulted copy constructor since you didn't supply your own.
Also, Am I going about this the hard way. What I mean is there a simpler way of coding the addCD() function so that passing data and adding these nodes to the linked lists is less...cantankerous?
Thanks for the spelling correction. I hadn't even noticed. LOL!
Been working on this all day and results are the same..crash!! I've been working on a copy constructor and I think that it works (only because I can step threw it in the debugger and I get no exceptions or errors) But I'm going to post it because I'm still having the same problem(the program trying to free already freed memory during clean up). I think the problem is the copy assignment operator. I have been looking around and I cant seem to find a good example of one for a linked list. Here is what I have so far:
Is my copy constuctor correct? What do I need to put in the assignment operator to get it to work? Do I need copy constructors for my derived CD class and if so does that mean I need one for the base class Media?
Thanks for the help so far. I feel like I'm getting close to making this work!(I'm definitely learning alot!!)
So the copy constructor dosen't work. I used a display function and it returned empty nodes. I need help with that too...Here is the display function for the LinkList class that I used. I added a call to it after the call to CDList.append() in main.
So do I need a copy constructor for my other classes to get this to work?
From a brief inspection of your code, it appears that the defaulted versions should work for your other classes, provided LinkList is implemented correctly. I would like to emphasize, though, that the inspection was not thorough.