int cmp(const void *a ,const void *b){ return *(int *)a - *(int *)b; } qsort(&data[1],n,sizeof(int),cmp);