Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
qsort a user-defined type
#2
Code:
Copy      Help
qsort &adatt[0] adatt.len sizeof(datt) &sort_datt

Function sort_datt:
Code:
Copy      Help
function[c] datt&d1 datt&d2

if(d1.age<d2.age) ret -1 ;;place d1 before
if(d1.age>d2.age) ret 1 ;;place d1 after


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)