liveBook · Manning

C standard library

As explained in Modern C, Third Edition

A C library function is a function provided by the standardized C library for use by C programs.

A C standard library function is a standardized function available to C programs through a defined interface and semantics. It supplies portable tools for everyday tasks while keeping library implementation separate from the compiler. section 8.0

Calling a library function

#include <stdio.h> int main(void) { puts("ready"); } The header supplies the interface declaration, and puts performs text output. Other familiar library functions include printf and strtod. section 8.0 section 8.1.1

The library groups related functionality behind standard headers:

  • stdio.h handles input and output, including text and raw-byte operations. section 8.9
  • math.h and tgmath.h support numerical functions, with tgmath.h providing type-generic macros. section 8.9
  • ctype.h, stdlib, and string.h support character processing, numerical conversion, and string manipulation. section 8.9
  • time.h represents calendar time for human interpretation and physical time in seconds and nanoseconds. section 8.9
Table 8.1 C library headers
Name Description Section
<assert.h> Asserting runtime conditions 8.8
<complex.h> Complex numbers 5.7.8
<ctype.h> Character classification and conversion 8.5
<errno.h> Error codes 8.1.3
<fenv.h> Floating-point environment 15.1.4
<float.h> Properties of floating-point types 5.7
<inttypes.h> Formatting conversion of integer types 5.7.6
<iso646.h> Alternative spellings for operators 4.2
<limits.h> Properties of integer types 5.1.3
<locale.h> Internationalization 8.7
<math.h> Type-specific numerical functions 8.3
<setjmp.h> Non-local jumps 19.5
<signal.h> Signal-handling functions 19.6
<stdalign.h> Alignment of objects 12.7
<stdarg.h> Functions with varying numbers of arguments 17.4.2
<stdatomic.h> Atomic operations 19.6
<stdbit.h> Bit operations 5.7.2
<stdbool.h> Booleans 3.1
<stdckdint.h> Checked integer arithmetic 8.2
<stddef.h> Basic types and macros 5.2
<stdint.h> Exact-width integer types 5.7.6
<stdio.h> Input and output 8.4
<stdlib.h> Basic functions 2
<stdnoreturn.h> Non-returning functions 7
<string.h> String handling 8.5
<tgmath.h> Type-generic numerical functions 8.3
<threads.h> Threads and control structures 20
<time.h> Handling time 8.6
<uchar.h> Unicode characters 14.3
<wchar.h> Wide strings 14.3
<wctype.h> Wide character classification and conversion 14.3

Use the header reference to locate interfaces for assertions, errors, character handling, floating-point properties, atomics, limits, locales, and other standard facilities. section 8.1.1

How Modern C, Third Edition covers it

How deep it goes
Surveys library groups and header interfaces, without descending into individual function implementations.
Examples
Uses printf, puts, strtod, standard headers, text and byte I/O, string processing, time handling, and environment variables.
What it assumes
Assumes basic C programming and introduces library interfaces alongside language elements already learned.
What you can do after
Apply it via standard headers and library functions when implementing common C programming tasks.
How it connects
Connects headers with application programming interfaces, compilers, library implementations, portability, and standard C types.

Also explained in

Compare how 3 books explain C standard library →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Modern C, Third Edition. The section links point to the parts of the book it draws on.