Friday, July 29, 2016

C Basics - Standard Library in C

The C standard library is the standard library for the C programming language, as specified in the ANSI C standard.It is also called the ISO C library.

The C standard library provides macros, type definitions and functions for tasks such as string handling, mathematical computations, input/output processing, memory management, and several other operating system services.

The application programming interface (API) of the C standard library is declared in a number of header files. Each header file contains one or more function declarations, data type definitions, and macros.

The POSIX standard added several nonstandard C headers for Unix-specific functionality.

Unix-like systems typically have a C library in shared library form.The C library is considered part of the operating system on Unix-like systems.

List of C Standard Library Header Files:
Name From Description
<assert.h>Contains the assert macro, used to assist with detecting logical errors and other types of bug in debugging versions of a program.
<complex.h> C99 A set of functions for manipulating complex numbers.
<ctype.h>Defines set of functions used to classify characters by their types or to convert between upper and lower case in a way that is independent of the used character set (typically ASCII or one of its extensions, although implementations utilizing EBCDIC are also known).
<errno.h>For testing error codes reported by library functions.
<fenv.h>C99 Defines a set of functions for controlling floating-point environment.
<float.h>Defines macro constants specifying the implementation-specific properties of the floating-point library.
<inttypes.h>C99 Defines exact width integer types.
<iso646.h>NA1 Defines several macros that implement alternative ways to express several standard tokens. For programming in ISO 646 variant character sets.
<limits.h>Defines macro constants specifying the implementation-specific properties of the integer types.
<locale.h>Defines localization functions.
<math.h>Defines common mathematical functions.
<setjmp.h>Declares the macros setjmp and longjmp, which are used for non-local exits.
<signal.h>Defines signal handling functions.
<stdalign.h>C11 For querying and specifying the alignment of objects.
<stdarg.h>For accessing a varying number of arguments passed to functions.
<stdatomic.h>C11 For atomic operations on data shared between threads.
<stdbool.h> C99 Defines a boolean data type.
<stddef.h> Defines several useful types and macros.
<stdint.h> C99 Defines exact width integer types.
<stdio.h>Defines core input and output functions
<stdlib.h>Defines numeric conversion functions, pseudo-random numbers generation functions, memory allocation, process control functions
<stdnoreturn.h> C11 For specifying non-returning functions.
<string.h>Defines string handling functions.
<tgmath.h>C99 Defines type-generic mathematical functions.
<threads.h> C11 Defines functions for managing multiple Threads as well as mutexes and condition variables.
<time.h>Defines date and time handling functions
<uchar.h> C11 Types and functions for manipulating Unicode characters.
<wchar.h>NA1 Defines wide string handling functions.
<wctype.h> NA1 Defines set of functions used to classify wide characters by their types or to convert between upper and lower case

Normative Addendum 1(NA1) added three new headers that added support for wide-characters, wide-strings, and international keyboard. The headers <iso646.h>, <wchar.h>, and <wctype.h> were added with NA1.

C99 introduced several new features like several new built-in data types (Boolean, complex), improved compatability with C++ features like one-line comment and inline functions, improved support for IEEE floating point, etc.. The headers <complex.h>, <fenv.h>, <inttypes.h>, <stdbool.h>, <stdint.h>, and <tgmath.h> were added with C99.

C11 is the current for the C. It includes several changes to the C99 language and library specifications, such as: Alignment specification, type-generic expressions, Multi-threading support, Improved Unicode support, Bound checking and Analyzability features, atomic type support,etc..



Related topics:
Memory Management in C   |   Incomplete Type in C   |   Lifetime, Scope, Visibility and Linkage in C   |   Namespace in C   |   Complex and Abstract Declarations in C   |   Storage of Data Types in C

List of topics: C Programming

No comments:

Post a Comment