![]() |
|
#1
|
|||
|
|||
Template Queue File using link listwell here is my whole header file this is the only part im having trouble with.
Also the header file is from a C++ book called "Problem Solving with C++: The Object of Programming" by Walter Savitch; heres the header file.. CPP / C++ / C Code:
the problem is with the typedef QueueNode* QueueNodePtr; dont know how to get around that since template typedefs arnt allowed. thank you. Last edited by LuciWiz : 03-May-2005 at 00:46.
Reason: Please insert your C++ code between [c++] & [/c++] tags
|
|||
|
#2
|
||||
|
||||
|
Well, let's just look at how they do this in the STL:
CPP / C++ / C Code:
So, we can achieve this by encapsulating the typedef in a struct or class. Which leads us to: CPP / C++ / C Code:
Of course, we could consider a flaw the fact that now we need to access the defined type trough the struct. But that's how they do it in the STL too: CPP / C++ / C Code:
Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#3
|
|||
|
|||
|
Well its not just the typedef thats the problem... its getting around where at the bottom under the private of class Queue
CPP / C++ / C Code:
|
|
#4
|
|||
|
|||
|
Ok thank you for your help I solved the problem instead of using two classes one holding the link list and one the queue functions I just combined them all into one class. Works flawlessly now.
|
Recent GIDBlog
Vista ?Widgets? on Windows XP by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 07:44 |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 13:12 |
| search linked list | itsmecathys | C++ Forum | 20 | 18-Apr-2005 01:34 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 11:28 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The