博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C标准函数库
阅读量:2171 次
发布时间:2019-05-01

本文共 2983 字,大约阅读时间需要 9 分钟。

在 程序设计里,C 标准函数库C Standard library)收集所有目前符合标准的(head file),以及常用的实现程序,例如 和控制。不像 、 和 等编程语言,在 C 语言的工作任务里不会包含嵌入的,所以几乎所有的 C 语言程序都是由标准函数库的函数来创建的。

目录

设计

每一个函数的名称与特性会被写成一个电脑文件,这个文件就称为,但是实际的函数实现是被分存到里。头文件的命名和领域是很常见的,但是函数库的组织架构也会因为不同的编译器而有所不同。标准函数库通常会随附在上。因为 C 编译器常会提供一些额外的非 函数功能,所以某个随附在特定编译器上的标准函数库,对其他不同的编译器来说,是不兼容的。

设计品质

大多 C 标准函数库在设计上做得相当不错。有些少部分的,会为了商业优势和利益,会把某些旧函数视同错误或提出警告。字符串输入函数 gets()(以及 scanf() 读取字符串输入的使用上)是很多的原因,而且大多的程序设计指南会建议避免使用它。另一个较为奇特的函数是 strtok(),它原本是作为早期的用途,但是它非常容易出错(fragile),而且很难使用。

历史沿革

1995年,Normative Addendum 1 (NA1)批准了三个头文件(iso646.h, wchar.h, and wctype.h)增加到C标准函数库中。标准增加了六个头文件(complex.h, fenv.h, inttypes.h, stdbool.h, stdint.h, and tgmath.h)。标准中又新增了5个头文件(stdalign.h, stdatomic.h, stdnoreturn.h, threads.h, and uchar.h)。至此,C标准函数库共29个头文件:

名字 源自 描述
  Contains the assert macro, used to assist with detecting logical errors and other types of bug in debugging versions of a program.
C99 A set of functions for manipulating .
  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 or one of its extensions, although implementations utilizing are also known).
  For testing error codes reported by library functions.
C99 Defines a set of functions for controlling environment.
  Defines macro constants specifying the implementation-specific properties of the library.
C99 Defines exact width integer types.
NA1 Defines several macros that are equivalent to some of the operators in C. For programming in variant character sets.
  Defines macro constants specifying the implementation-specific properties of the integer types.
  Defines C localization functions.
  Defines C mathematical functions.
  Declares the macros setjmp and longjmp, which are used for non-local exits.
  Defines C signal handling functions.
C11 For querying and specifying the data structure alignment of objects.
  For accessing a varying number of arguments passed to functions.
C11 For atomic operations on data shared between threads.
C99 Defines a boolean data type.
  Defines several useful types and macros.
C99 Defines exact width integer types.
  Defines core input and output functions
  Defines numeric conversion functions, pseudo-random numbers generation functions, dynamicmemory allocation, process control functions
C11 For specifying non-returning functions.
  Defines C string handling functions.
C99 Defines type-generic mathematical functions.
C11 Defines functions for managing multiple threads as well as mutexes and condition variables.
  Defines date and time handling functions
C11 Types and functions for manipulating characters.
NA1 Defines wide string handling functions.
NA1 Defines set of functions used to classify wide characters by their types or to convert between upper and lower case

参考资料

其他项目

外部链接

  • :A detailed description of the header files
  • Microsoft on MSDN

转载地址:http://tmqzb.baihongyu.com/

你可能感兴趣的文章
Leetcode Go 《精选TOP面试题》20200628 69.x的平方根
查看>>
leetcode 130. Surrounded Regions
查看>>
【托业】【全真题库】TEST2-语法题
查看>>
博客文格式优化
查看>>
【托业】【新托业全真模拟】疑难语法题知识点总结(01~05)
查看>>
【SQL】group by 和order by 的区别。
查看>>
【Python】详解Python多线程Selenium跨浏览器测试
查看>>
Jmeter之参数化
查看>>
Shell 和Python的区别。
查看>>
Python 列表(list)、字典(dict)、字符串(string)常用基本操作小结
查看>>
Loadrunner之https协议录制回放报错如何解决?(九)
查看>>
python中xrange和range的异同
查看>>
列表、元组、集合、字典
查看>>
【Python】easygui小甲鱼
查看>>
【Python】关于Python多线程的一篇文章转载
查看>>
【Pyton】【小甲鱼】文件
查看>>
【Pyton】【小甲鱼】永久存储:腌制一缸美味的泡菜
查看>>
【Pyton】【小甲鱼】异常处理:你不可能总是对的
查看>>
APP性能测试工具
查看>>
【Pyton】【小甲鱼】类和对象
查看>>