Hey guys, I'm having trouble with qsort. I just want to sort 10 numbers in ascending order. I've even copied in the code from the examples on this and other sites. The problem is that when I enter the numbers from 1-10 in that order, it sorts fine. But
sometimes for no apparent reason(usually if I start with 10) it sorts the numbers and when I print them I get my numbers times 10 and even then it's not in order.
Here's an example of my running program and output:
Enter number 1: 10
Enter number 2: 9
Enter number 3: 8
Enter number 4: 7
Enter number 5: 6
Enter number 6: 5
Enter number 7: 4
Enter number 8: 3
Enter number 9: 2
Enter number 10: 1
1 - Ascending
2 - Descending
1
10
30
40
50
60
70
80
90
20
10



LinkBack URL
About LinkBacks




. I like the idea of passing the argument though.