liveBook · Manning

Qsort

qsort is a C standard-library function that sorts an array using a caller-supplied comparison function.

How 2 Manning books explain it

Modern C, Third Edition

qsort is a C standard library function that sorts the elements of an array using a caller-supplied comparison function.

How it is used
Deploys qsort as a generic in-place array-sorting interface driven by a caller-supplied ordering function.
How deep it goes
Explains parameters, comparator results, type erasure, and overflow safety, but does not describe the sorting algorithm's implementation.
Examples
Uses unsigned comparison and contrasts explicit ordering tests with an overflowing integer subtraction comparator.
What you can do after
Apply it via the C standard library by supplying correctly sized elements and a consistent, overflow-safe comparator.

Read how Modern C, Third Edition explains qsort →

Modern C

qsort is a C standard library function that sorts an array using a caller-provided comparison function.

How it is used
Sorts arrays generically by combining element metadata with a caller-supplied ordering function.
How deep it goes
Defines parameters and comparator rules, then warns about overflow but defers the sorting algorithm’s internals.
Examples
Uses unsigned comparison, an invalid subtracting integer comparator, and a type-specific qsort wrapper.
What you can do after
Apply it via the C standard library by supplying correctly sized elements and a consistent comparator.

Read how Modern C explains qsort →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.