Utility functions and macros used in C

Utility functions are used for searching, sorting, arguments processing, and conversions. To use a utility function you have to include header <cstdlib>.

The following macros are used for utility functions:

Macro Usage
NULL For a null pointer
EXIT_SUCCESS For a process if program is terminated
EXIT_FAILURE For a process if program is not terminated
RAND_MAX Maximum value returned by rand() function

Examples of utility functions: abort, abs, bsearch, exit, qsort, rand, signal system.

Leave a Reply