I have a template class containing a pointer to a list, the constructor for this class takes in a pointer List as parameter, but i am stuck in how i copy the parameter to the classes datamember?
Ouu, so i can not choose it by throwing in the type of list I want?
I need to let the user choose what kind of list they want, and fillthis list with random number. The usual guessing game but here the jser first chooses int oe double. So i have to have two datamemvers of ListManipulator in UserInterface to make this happen?
If you are familiar with inheritance and virtual functions you might be able to accomplish something that is relatively close to what you just tried by creating a base class that every ListManipulator<T> inherit from. That way you could let your UserInterface contain a base pointer that could point to any ListManipulator<T>, but that only works if all of them have the same interface.
So i have to have two datamemvers of ListManipulator in UserInterface to make this happen?
That is one way of doing it. You will probably end up with some code repetition but it should work.
Thank you Peter. I tried this, but myList still comes up as "undefined". I did let ListManipulator be the base and created 2 derived classes from it for Int and Double. UI uses ListManipulator, but its object stays as undefined.