Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use qsort over sort in C++?

I have browsed through most of the questions on the comparison between qsort vs sort in C++. I wanted to just ask if there were any cases where you would prefer qsort over sort?

like image 389
Vedant Dixit Avatar asked Oct 24 '25 15:10

Vedant Dixit


1 Answers

Probably none, std::sort is type safe, plus it can inline the comparator function. The only distinctive strong point of qsort is that it's available in plain C.

like image 78
Minor Threat Avatar answered Oct 26 '25 07:10

Minor Threat