liveBook · Manning

C standard library

As explained in Modern C

The C standard library is the standardized collection of library functions, macros, and types provided for C programs.

The C standard library is the standardized collection of functions, macros, and types that supplies portable interfaces for everyday programming. It complements the C language with tools for mathematics, files, strings, time, runtime access, and program termination. section 8.0

Its interfaces organize common programming tasks into related areas:

  • Mathematical functions support numerical work, preferably through type-generic macros from tgmath.h. section 8.8
  • Input and output use stdio.h for text, formatted data, and raw bytes. section 8.8
  • String processing combines character classification, numerical conversion, and string manipulation through ctype.h, stdlib, and string.h. section 8.8
  • Time, environment access, and termination are handled through time.h, getenv, locale.h, and related interfaces. section 8.0 section 8.8

Separating formatting from output

printf combines formatting with output. snprintf can perform the formatting into a string, which puts can then print, making the two responsibilities visible as separate operations. section 8.1

Clear interfaces and semantics promote portability and can separate compiler implementations from library implementations. Later interfaces depend more heavily on pointers, especially for formatted input, extended character sets, binary streams, and error handling. section 8.0 section 14.0

How Modern C covers it

How deep it goes
Defines library areas, headers, interface types, error strategies, safety interfaces, and compile-time platform checks.
Examples
Uses printf, puts, strtod, snprintf, getenv, and standard headers to illustrate library interfaces and functional groupings.
What it assumes
Builds from familiar functions before extending treatment to pointers, formatted input, binary streams, and clean error handling.
What you can do after
Apply it via standard headers and library functions for portable numerical, textual, temporal, environmental, and input/output operations.
How it connects
Connects the C language, application programming interfaces, compilers, headers, pointers, streams, locales, and runtime environments.

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. The section links point to the parts of the book it draws on.