C Standard Library -Reference Manual
C is a general-purpose, procedural computer programming language. In 1972, Dennis Ritchie designed and developed C at Bell Telephone Laboratories in order to port and develop the UNIX operating system.
C is a widely used computer language, as popular as the Java programming language, and both are widely used among modern software programmers.
The C Standard Library contains a set of header files that provide many functions and macros for handling common programming tasks such as input/output, string manipulation, mathematical calculations, and memory management.
Who is this tutorial for?
The C standard library can serve as a reference manual for C programmers, who can consult this manual when developing system programming related projects. Every system-related step serves as a reference for them. We explain all C functions in an easy-to-understand manner, and you can directly copy and use these items in your projects.
What you need to know before reading this tutorial
A basic understanding of the C language will help you understand the C built-in functions covered by this standard library.
Compile/Execute C Program
If you want to learn C programming on a Linux server but do not have the relevant configuration environment, you can visitC Online CompilerYou can experience real programming on high-end servers with just a simple click. This is a completely free online tool.
Standard Library
| Header file | Function Introduction |
|---|---|
| <stdio.h> | Standard input/output library, includingprintf、scanf、fgets、fputsand other functions. |
| <stdlib.h> | Standard library functions, including memory allocation, program control, conversion functions, etc., such asmalloc、free、exit、atoi、randetc. |
| <string.h> | String manipulation functions, such asstrlen、strcpy、strcat、strcmpetc. |
| <math.h> | Mathematical function library, containing various mathematical operation functions, such assin、cos、tan、exp、log、sqrtetc. |
| <time.h> | Time and date functions, such astime、clock、difftime、strftimeetc. |
| <ctype.h> | Character handling functions, such asisalpha、isdigit、isspace、toupper、toloweretc. |
| <limits.h> | Defines limit values for various types, such asINT_MAX、CHAR_MIN、LONG_MAXetc. |
| <float.h> | Defines limit values for floating-point types, such asFLT_MAX、DBL_MINetc. |
| <assert.h> | Contains macrosassertUsed for assertion checking during debugging. |
| <errno.h> | Defines error code variableserrnoAnd related macros, used to represent and handle errors. |
| <stddef.h> | Defines some generic types and macros, such assize_t、ptrdiff_t、NULLetc. |
| <signal.h> | Defines functions and macros for handling signals, such assignal、raiseetc. |
| <setjmp.h> | Macros and functions that provide non-local jump functionality, such assetjmp、longjmpetc. |
| <locale.h> | Defines functions and macros related to localization, such assetlocale、localeconvetc. |
| <stdarg.h> | Provides macros for handling variadic functions, such asva_start、va_arg、va_endetc. |
| <stdbool.h> | Defines boolean types and valuestrueandfalse。 |
| <stdint.h> | Defines integer types with exact widths, such asint8_t、uint16_tetc. |
| <inttypes.h> | Provides formatting output macros and functions related to integer types. |
| <complex.h> | Provides functions and macros for complex number operations, such ascabs、cargetc. |
| <tgmath.h> | Provides macros for generic mathematical functions to simplify mathematical operations on different types of data. |
| <fenv.h> | Provides control over the floating-point environment, such as rounding modes and exception states. |