can anyone help give a sample use of this function?
It is found in the <stdlib.h> library.
I want to sort an array of structs in ascending order with this function.
Code:
#include<iostream.h>
struct type{int a,b;};
int main()
{
list<type>[10];
for(int x=9;x>0;x--) //fill in values
{
list[x]=x;
}
//qsort function here
for(x=0;x<10;x++) //output array in order
{
cout<<list[x];
}
return 0;
}