I have a phone directory program. I need to display the directory by last name in alphabetical order. I have used an array called tele this array is of the type infoType.
Below is the sort algorithm I tried to use. When I tried to use the relation operators on the structure I got all sorts of errors. Come to find out ...
"The only built- in operations on a struct are the assignment and member access operations."
"Neither arithmetic nor relations operations are allowed on struct(s)"
That's what my lovely reference says.
C++ Programming from Problem Analysis to Program Design
D.S Malik
So how can I do this without getting so complicated if it can be done. I know that the sort function is probably out of sorts but the framework is there this is what I have as of now.
As you can see, there's no point in having the sort function, so you can just call std::sort directly instead.
Really? Not that I don't belive you but you should write the author of my book and tell him to quit selling bull*hit lol :)
That makes no sense without knowing the full context and it's not worth bothering either. Books about programming (C++ in particular) being of poor quality are the rule rather than the exception.