![]() |
|
#1
|
|||
|
|||
Problem of adding values in pair then print them.Hi, fellows, I had a problem about adding a student's name and a unit name in pair into a linked list,then print out student's names under the certain unit or print out unit names a student enrolled. I was doing my way, but seems dosen't work, anyone can help me or point out where i should amend. I also stuck to how to write a destructor, any ideas?
Here is my header file .h CPP / C++ / C Code:
Here is implementation file: school.cpp CPP / C++ / C Code:
and finally, my main program: schoolMain.cpp CPP / C++ / C Code:
Last edited by LuciWiz : 03-Nov-2007 at 17:04.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#2
|
|||
|
|||
Re: problem of adding values in pair then print them.Quote:
For, example to print all the students for a given unit shouldn't it go something like the following? Code:
And similarly for printing all units of a given student. Regards, Dave |
|
#3
|
|||
|
|||
Re: problem of adding values in pair then print them.yeah ....Dave ..I ve already worked it out like following :
CPP / C++ / C Code:
but i am facing another problem, is how to print student's names or units name alphabetically in ascending order. I am thinking now .....but anyway ....thanks Dave Last edited by LuciWiz : 03-Nov-2007 at 17:06.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#4
|
||||
|
||||
Re: problem of adding values in pair then print them.After 37 posts and uncounted edits by the administration, you'd think that by now you'd be able to use CODE tags properly. Is there something about the statement
Quote:
And is Quote:
![]() __________________
Age is unimportant -- except in cheese |
|
#5
|
|||
|
|||
Re: problem of adding values in pair then print them.Quote:
Designing a sort yourself is a bit more complicated. Before you begin to design a sort, learn how to insert nodes and how to remove nodes from the list. And some sorting algorithm would help too, probably. __________________
Music, programming, endless learning.. |
|
#6
|
|||
|
|||
Re: problem of adding values in pair then print them.Hi Kimmo,
Can u give me some examples how to copy my code to a STL vector container,then sort and print, cause i have not started to study what STL container is . Cheers ! |
Recent GIDBlog
Observations of Iraq by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Fortran problem... | Justin Fox | Miscellaneous Programming Forum | 6 | 24-Oct-2006 15:30 |
| Convert sentence to morse code | earachefl | C++ Forum | 8 | 03-May-2006 07:39 |
| problem with switches | ChaosTheory | C Programming Language | 2 | 31-May-2005 13:38 |
| Strange problem when I try to print a value? | 7eleven | C Programming Language | 2 | 15-May-2004 10:45 |
| Guestbook error | BobbyDouglas | Web Design Forum | 1 | 16-Oct-2003 22:17 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The