A
Allie
Richard said:Incidentally, you have misquoted me. I most certainly did not write:
sizeof( book ) / sizeof ( book[0] )
Your original qsort( book, sizeof book / sizeof book[0], sizeof
book[0], comptitle ); did not work... so I had to adjust it.
This is what I get as output when I use your qsort:
Inventory of books printed in alphabetical order by title:
AUTHOR TITLE CODE #COPY #BORR #AVAIL
Galvin Operating Systems G02 15 2 13
Golumbic Graph Theory G01 5 2 3
Habermann Operating Systems H01 10 5 5
Herzog Computing Structures H03 10 7 3
Holub Compiler Design H05 11 8 3
Horowitz Programming Languages H06 16 10 6
Hughs Structured Programming H02 4 4 0
Hunter Understanding C H04 6 6 0
Jacobs Database Logic J01 3 1 2
Kanter Management Information K01 8 1 7
Kindred Data Systems K04 2 0 2
Kleinrock Queueing Systems K03 14 0 14
Kuo Numerical Methods K02 2 0 2
Lane Data Communications L01 20 3 17
Mano Computer Architecture M01 2 2 0
Schroder C S01 7 2 5
The books are listed alphabetically by author because that's what the
previous function (using qsort( book, n, sizeof( book[0] ), compauthor
) did. sortbytitle() didn't do anything to the library.