Translations of this page?:

标准C库

C++程序员可以使用各种标准C库中的函数,定义在ISO/IEC 9899:1990 (公认为C90). 这些库中所有的函数定义在 std 命名空间.

C库函数

下列是一个标准C库函数的列表,粗略的根据功能分组:

标准C头文件

上面所说的函数定义在下列18个头文件中:

  • <cassert>
  • <ciso646>
  • <csetjmp>
  • <cstdio>
  • <ctime>
  • <cctype>
  • <climits>
  • <csignal>
  • <cstdlib>
  • <cwchar>
  • <cerrno>
  • <clocale>
  • <cstdarg>
  • <cstring>
  • <cwctype>
  • <cfloat>
  • <cmath>
  • <cstddef>

当为标准C库包含头文件时,推荐使用包含cfile方式取代file.h方式。例如, 包含stdio.h 头文件使用这个命令:

  #include <cstdio>

file.h方式可以使用,但它主要是为了向后兼容性。 cfilefile.h 方式的区别是通过 file.h 方式包含进来的函数出现在全局命名空间,而不是在 std 命名空间中。

参见: The 2005 C99 working paper 来自 Approved Standards of working group 14.

 
• • • SitemapRecent changesRSScc