![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Feb 2008
Posts: 6
Rep Power: 0
![]() |
one class to implement a linked list of objects of another class
say you're managing a stock portfolio... of class Portfolio, and it is to contain a linked list of several of class Stock... or more like... Portfolio is supposed to contain a Node structure to contain each Stock and the pointer to the head list... is this how it is done?
c++ Syntax (Toggle Plain Text)
Does this node actually contain a full Stock object instance? Or does a node within the Portfolio class only contain the pointer? There was some template for doing things like this... but I forget how that's done... let me attempt a more generic example... c++ Syntax (Toggle Plain Text)
Note that NO inheritance is used here. Portfolio does not inherit anything from Stock or vice versa. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| linked list problems | bl00dninja | C++ | 6 | Feb 17th, 2008 10:30 AM |
| Linked List Of Objects | Ade | C++ | 10 | May 14th, 2007 10:25 AM |
| singly-linked list templaste class in C++ w/ example driver | bl00dninja | Show Off Your Open Source Projects | 0 | Sep 11th, 2006 1:05 AM |
| Singly Linked List Help | Firebar | Java | 3 | May 22nd, 2005 10:56 AM |
| airport Log program using 3D linked List : problem reading from file | gemini_shooter | C++ | 0 | Mar 2nd, 2005 4:12 PM |