![]() |
|
#1
|
|||
|
|||
Help creating lists of pointersHi,
I have build a binary tree and each node of this tree contains a number of messages sent, message received and messages transmitted. What I want to do is to go through the tree and add the information of each node into a separated list (there's a different list for the 3 type of message). Now my tree is already build with the correct information and I know how to go through the tree in a fix order. My problem is when it comes to creating the lists. First, I have declared the three of them like this: Code:
So far, so good I hope. Then, I start reading elements of the tree and this is where I'm bugged. Let's say the first node has 1 sent msg, 5 transmited msg and 2 received msg. I need to add a listitem to the list messSnt[1] (the ptrNode member of this new listitem will point on this node), add an a list item to messTrs[5] (the prtNode member of this new listitem will also points on this node) and same thing for the received msg. This way, once I finish going through the tree, I will have build every lists needed to print my reports. I started creating the function that build the lists and here's what it looks like (note that I started by doing it only for 1 kind of msg). Code:
If would really appreciate if anyone could tell me how to actually add an item correctly to my lists and if I'm going in the right direction. If you need more information or more code, please let me know and I will post it. Thanks a lot for your time and support, Frank |
Recent GIDBlog
Halfway done! by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| isThere pointers in PHP | sajuat | MySQL / PHP Forum | 1 | 20-Nov-2006 09:18 |
| help with delete function using pointers!!! | wbsquared03 | C++ Forum | 0 | 29-Nov-2004 16:32 |
| Problem with the function creating updating a linked list | nkhambal | C Programming Language | 3 | 28-Oct-2004 20:45 |
| Help with C++ pointers | Mjkramer21 | C++ Forum | 23 | 18-Apr-2004 07:53 |
| Passing Pointers To Pointers in Functions | elumira | C Programming Language | 8 | 05-Mar-2004 21:23 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The