Quote:
Originally posted by wossname
Thanks.
1 Since I posted this thread, I've created a DLL in C++ that contains classes for Stack, Queue, Deque (pronounced "deck"). All implemented with linked lists.
At the moment the data part of each list item is just an integer. But say I wanted to use these classes in any future program with any kind of data (new classes fo instance) how would I rewrite the listitem class? Would I just create an interface and have a pointer to it (rather than the integer) and any classes that I want to attach to the list would have to implement that class?
OOP is so funky! :bigyello:
2 If I nullify the pointer to the first item in the list (the head item) will the whole list be free'd up in memory like a chain reaction?
In the new C# you can have templates so i believe you can make a template for that class