![]() |
|
#1
|
|||
|
|||
help with tele directory problem due tomorrowthis program you are implementing a C++ class to generate a new telephone directory using Sorted List in terms of last name.
i keep getting this error c:\Documents and Settings\Sean Walsh\My Documents\Visual Studio Projects\sorted\teldir.cpp(83): error C2676: binary '<' : 'ItemType' does not define this operator or a conversion to a type acceptable to the predefined operator it also doesn't take != and > operators. Can anyone figure what is going on with this and help me out a little becuase im stuck. CPP / C++ / C Code:
its not finished (the main and the whole program) because i can't fix that one mistake. If someone could gratiously help me out it would be appreciated, so confused. --wb |
|
#2
|
||||
|
||||
|
Hi wbsquared03.
Please disregard if I am up in the night, but I don't believe that you can compare an entire structure with the standard comparison operators. Your program really doesn't know what you want to compare with what in this case. CPP / C++ / C Code:
My solution would be to make a compare function (similar to strcmp) or do a class and try overload the comparison operators to work like you want. __________________
The best damn Sports Blog period. |
|
#3
|
|||
|
|||
|
i think maybe i'll shoot myself instead of doing the program lol.........
![]() |
|
#4
|
||||
|
||||
|
Quote:
No - Don't do that! ![]() Really, the reccmp function should be very simple to write: CPP / C++ / C Code:
That is thrown together very quickly, but it should give an idea how this works. It could probably be written more efficiently and with a single exit point (Waltp would hate it ), but it works.Does that make sense? __________________
The best damn Sports Blog period. |
|
#5
|
|||
|
|||
|
Quote:
It makes sense but unfortunatly i will have to look at it later, i didn't get around to the boards again until what is now about 11:30 and i have an 8am class with required attendance. My prof should understand and hopefully give me more time to explore this program, and if not, i wrote most of the program just had trouble with the comparing, and when he sees that i should hopefully get a decent amount of credit thanks for the help, much is appreciated as always. |
|
#6
|
||||
|
||||
|
Quote:
But making a function just to call a function... ![]() __________________
Cow: You're a lawyer too? Mooseblood (mosquito): Ma'am, I was already a bloodsucking parasite. All I needed was a briefcase! |
Recent GIDBlog
Last Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CD burner will not burn, new problem | sdshaman | Computer Hardware Forum | 4 | 06-Feb-2008 23:17 |
| Apache2 config issues | monev | Apache Web Server Forum | 2 | 28-Jun-2004 06:19 |
| Can't view pages from another machine on the Intranet | aevans | Apache Web Server Forum | 9 | 14-May-2004 02:26 |
| Another FX 5600 problem (but with details that might shed light on this) | BobDaDuck | Computer Hardware Forum | 2 | 16-Apr-2004 07:53 |
| problem with php5 cgi installation | fab13 | Apache Web Server Forum | 3 | 19-Nov-2003 09:11 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The