From WikiChip
Editing c/standard library

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
{{c title|Standard Library}}
 
 
The '''C standard library''' is a [[standard library|standardized collection]] of headers and library functions for the [[C|C programming language]]. The library provides a set of commonly used macros, type definitions, and functions to perform common tasks such as [[string manipulation|string handling]], [[IO processing|input/output processing]], [[memory allocation]], [[math computations]], [[thread management]], and various other common services.
 
The '''C standard library''' is a [[standard library|standardized collection]] of headers and library functions for the [[C|C programming language]]. The library provides a set of commonly used macros, type definitions, and functions to perform common tasks such as [[string manipulation|string handling]], [[IO processing|input/output processing]], [[memory allocation]], [[math computations]], [[thread management]], and various other common services.
  
Line 9: Line 8:
 
Standard C provides 29 standard headers. The headers may be included in any order. The headers may also be included more than once - the effect of that is as if it was only included once. All standard C functions have external linkage.
 
Standard C provides 29 standard headers. The headers may be included in any order. The headers may also be included more than once - the effect of that is as if it was only included once. All standard C functions have external linkage.
  
{{collist
+
{| style="width: 600px; margin-left: auto; margin-right: auto;"
| count  = 5
+
|<[[assert.h]]>
| center = yes
+
|<[[complex.h]]>
| width = 650px
+
|<[[ctype.h]]>
|
+
|<[[errno.h]]>
* {{c header|assert.h}}
+
|<[[fenv.h]]>
* {{c header|complex.h}}
+
|-
* {{c header|ctype.h}}
+
|<[[float.h]]>
* {{c header|errno.h}}
+
|<[[inttypes.h]]>
* {{c header|fenv.h}}
+
|<[[iso646.h]]>
* {{c header|float.h}}
+
|<[[limits.h]]>
* {{c header|inttypes.h}}
+
|<[[locale.h]]>
* {{c header|iso646.h}}
+
|-
* {{c header|limits.h}}
+
|<[[math.h]]>
* {{c header|locale.h}}
+
|<[[setjmp.h]]>
* {{c header|math.h}}
+
|<[[signal.h]]>
* {{c header|setjmp.h}}
+
|<[[stdalign.h]]>
* {{c header|signal.h}}
+
|<[[stdarg.h]]>
* {{c header|stdalign.h}}
+
|-
* {{c header|stdarg.h}}
+
|<[[stdatomic.h]]>
* {{c header|stdatomic.h}}
+
|<[[stdbool.h]]>
* {{c header|stdbool.h}}
+
|<[[stddef.h]]>
* {{c header|stddef.h}}
+
|<[[stdint.h]]>
* {{c header|stdint.h}}
+
|<[[stdio.h]]>
* {{c header|stdio.h}}
+
|-
* {{c header|stdlib.h}}
+
|<[[stdlib.h]]>
* {{c header|stdnoreturn.h}}
+
|<[[stdnoreturn.h]]>
* {{c header|string.h}}
+
|<[[string.h]]>
* {{c header|tgmath.h}}
+
|<[[tgmath.h]]>
* {{c header|threads.h}}
+
|<[[threads.h]]>
* {{c header|time.h}}
+
|-
* {{c header|uchar.h}}
+
|<[[time.h]]>
* {{c header|wchar.h}}
+
|<[[uchar.h]]>
* {{c header|wctype.h}}
+
|<[[wchar.h]]>
}}
+
|<[[wctype.h]]>
 +
|}
 +
 
  
 
== Optional headers ==
 
== Optional headers ==
Line 49: Line 50:
 
3 of the 29 standard headers are optional:
 
3 of the 29 standard headers are optional:
  
* {{C|complex.h|<complex.h>}}
+
* <[[complex.h]]>
* {{C|stdatomic.h|<stdatomic.h>}}
+
* <[[stdatomic.h]]>
* {{C|threads.h|<threads.h>}}
+
* <[[threads.h]]>
  
 
While implementations are encouraged to support those headers, they are not required to.
 
While implementations are encouraged to support those headers, they are not required to.
Line 62: Line 63:
 
! Header Name !! Since !! Description
 
! Header Name !! Since !! Description
 
|-
 
|-
|{{C|assert.h|<assert.h>}} || C89 || Provides a set of assertion macros used in assisting  with debugging and detecting logic errors.
+
|<[[assert.h]]> || C89 || Provides a set of assertion macros used in assisting  with debugging and detecting logic errors.
 
|-
 
|-
|{{C|complex.h|<complex.h>}} || C99 || Provides a set of functions used to manipulate complex numbers.
+
|<[[complex.h]]> || C99 || Provides a set of functions used to manipulate complex numbers.
 
|-
 
|-
|{{C|ctype.h|<ctype.h>}} || C89 || Provides a set of functions used for classifying characters.
+
|<[[ctype.h]]> || C89 || Provides a set of functions used for classifying characters.
 
|-
 
|-
|{{C|errno.h|<errno.h>}} || C89 || Provides a set of predefined values for {{C|errno}}.
+
|<[[errno.h]]> || C89 || Provides a set of predefined values for [[errno (C)|errno]].
 
|-
 
|-
|{{C|fenv.h|<fenv.h>}} || C99 || Provides a set of functions for controlling the floating-point environment.
+
|<[[fenv.h]]> || C99 || Provides a set of functions for controlling the floating-point environment.
 
|-
 
|-
|{{C|float.h|<float.h>}} || C89 || Provides a set of macros defining the implementation of the floating-point environment.
+
|<[[float.h]]> || C89 || Provides a set of macros defining the implementation of the floating-point environment.
 
|-
 
|-
|{{C|inttypes.h|<inttypes.h>}} || C99 || Provides a set of exact width integer types.
+
|<[[inttypes.h]]> || C99 || Provides a set of exact width integer types.
 
|-
 
|-
|{{C|iso646.h|<iso646.h>}} || NA1 || Provides a set of macros that implement an alternative way of expressing various C operators
+
|<[[iso646.h]]> || NA1 || Provides a set of macros that implement an alternative way of expressing various C operators
 
|-
 
|-
|{{C|limits.h|<limits.h>}} || C89 || Provides a set of macros specifying the implementation-specific limits of the integer types.
+
|<[[limits.h]]> || C89 || Provides a set of macros specifying the implementation-specific limits of the integer types.
 
|-
 
|-
|{{C|locale.h|<locale.h>}} || C89 || Provides a set of functions localization functions
+
|<[[locale.h]]> || C89 || Provides a set of functions localization functions
 
|-
 
|-
|{{C|math.h|<math.h>}} || C89 || Provides a set of common mathematical functions.
+
|<[[math.h]]> || C89 || Provides a set of common mathematical functions.
 
|-
 
|-
|{{C|setjmp.h|<setjmp.h>}} || C89 || Provides macros to perform non-local jump operators.
+
|<[[setjmp.h]]> || C89 || Provides macros to perform non-local jump operators.
 
|-
 
|-
|{{C|signal.h|<signal.h>}} || C89 || Provides a set of signal handling functions.
+
|<[[signal.h]]> || C89 || Provides a set of [[signal handling]] functions.
 
|-
 
|-
|{{C|stdalign.h|<stdalign.h>}} || C11 || Provides a set of macros for working with object alignments.
+
|<[[stdalign.h]]> || C11 || Provides a set of macros for working with [[object alignments]].
 
|-
 
|-
|{{C|stdarg.h|<stdarg.h>}} || C89 || Provides a set of macros for working with variadic functions
+
|<[[stdarg.h]]> || C89 || Provides a set of macros for working with [[variadic function]]s
 
|-
 
|-
|{{C|stdatomic.h|<stdatomic.h>}} || C11 || Provides a set of functions for performing atomic operations on data.
+
|<[[stdatomic.h]]> || C11 || Provides a set of functions for performing [[atomic operations]] on data.
 
|-
 
|-
|{{C|stdbool.h|<stdbool.h>}} || C99 || Provides boolean macros.
+
|<[[stdbool.h]]> || C99 || Provides [[boolean]] macros.
 
|-
 
|-
|{{C|stddef.h|<stddef.h>}} || C89 || Provides a set of commonly used type definitions within the standard library.
+
|<[[stddef.h]]> || C89 || Provides a set of commonly used type definitions within the standard library.
 
|-
 
|-
|{{C|stdint.h|<stdint.h>}} || C99 || Provides a set of exact width integer types.
+
|<[[stdint.h]]> || C99 || Provides a set of exact width integer types.
 
|-
 
|-
|{{C|stdio.h|<stdio.h>}} || C89 || Provides a set of standard input/output processing functions.
+
|<[[stdio.h]]> || C89 || Provides a set of standard input/output processing functions.
 
|-
 
|-
|{{C|stdlib.h|<stdlib.h>}} || C89 || Provides core library functions such as memory management and random number generation.
+
|<[[stdlib.h]]> || C89 || Provides core library functions such as memory management and random number generation.
 
|-
 
|-
|{{C|stdnoreturn.h|<stdnoreturn.h>}} || C11 || Provides a macro for specifying non-returning functions.
+
|<[[stdnoreturn.h]]> || C11 || Provides a macro for specifying [[non-returning functions]].
 
|-
 
|-
|{{C|string.h|<string.h>}} || C89 || Provides a set of string handling|string handling functions.
+
|<[[string.h]]> || C89 || Provides a set of [[string handling|string handling functions]].
 
|-
 
|-
|{{C|tgmath.h|<tgmath.h>}} || C99 || Provides a set of type-generic math functions.
+
|<[[tgmath.h]]> || C99 || Provides a set of type-generic math functions.
 
|-
 
|-
|{{C|threads.h|<threads.h>}} || C11 || Provides a set of thread management functions.
+
|<[[threads.h]]> || C11 || Provides a set of [[thread management]] functions.
 
|-
 
|-
|{{C|time.h|<time.h>}} || C89 || Provides a set of date and time handling functions.
+
|<[[time.h]]> || C89 || Provides a set of [[date and time handling]] functions.
 
|-
 
|-
|{{C|uchar.h|<uchar.h>}} || C11 || Provides a set of Unicode character manipulation functions.
+
|<[[uchar.h]]> || C11 || Provides a set of [[Unicode]] character manipulation functions.
 
|-
 
|-
|{{C|wchar.h|<wchar.h>}} || NA1 || Provides a set of wide string handling|string handling functions.
+
|<[[wchar.h]]> || NA1 || Provides a set of wide [[string handling|string handling functions]].
 
|-
 
|-
|{{C|wctype.h|<wctype.h>}} || NA1 || Provides a set of functions used for classifying wide characters.
+
|<[[wctype.h]]> || NA1 || Provides a set of functions used for classifying wide characters.
 
|}
 
|}
  
 
== Embedded C ==
 
== Embedded C ==
{{main|c/embedded|l1=Embedded C}}
+
{{main|Embedded C}}
Embedded C introduced two optional headers {{C|stdfix.h|<stdfix.h>}} and  {{C|iohw.h|<iohw.h>}}. The headers not formally part of the standard library.
+
Embedded C introduced two optional headers [[stdfix.h - C|<stdfix.h>]] and  [[iohw.h - C|<iohw.h>]]. The headers not formally part of the standard library.
  
 
== See also ==
 
== See also ==

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)