You will have to sort all the information you want to print out before you print the information.
Obtain all items to print.
Sort items to print.
Print items.
The process that does the sorting can be any of a number of protocols including bubble sort, quick sort, insert sort, the sort algorhythms from the Standard Template Library, etc. Which sorting protocol is best for you depends on your knowledge base, how many items you have to sort, how random the original series is, etc, etc.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Offline 2,253 posts
since Jul 2005