O'Reilly logo

C Primer Plus, Fourth Edition by Stephen Prata

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The General Utilities Library

The general utilities library contains a grab bag of functions, including a random number generator, searching and sorting functions, conversion functions, and memory management functions. You've already seen rand(), srand(), malloc(), and free() in Chapter 12, “Storage Classes, Linkage, and Memory Management.” Under ANSI C, prototypes for these functions exist in the stdlib.h header file. Reference Section V lists all the functions in this family; we'll take a closer look at a few of them now.

The exit() and atexit() Functions

We've already used exit() explicitly in several examples. In addition, the exit() function is invoked automatically upon return from main(). The ANSI standard has added a couple of nice features ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required