C标准库

C Language Library
The C++ library includes the same definitions as the C language library organized in the same structure of header files, with the following differences:
  • Each header file has the same name as the C language version but with a "c" prefix and no extension. For example, the C++ equivalent for the C language header file <stdlib.h> is <cstdlib>.
  • Every element of the library is defined within the std namespace.
Nevertheless, for compatibility with C, the traditional header names name.h (like stdlib.h) are also provided with the same definitions within the global namespace. In the examples provided in this reference, this version is used so that the examples are fully C-compatible, although its use is deprecated in C++.

The are also certain specific changes in the C++ implementation:
  • wchar_t is a fundamental type in C++ and therefore does not appear as a defined type in the corresponding header files where it appears in C. The same applies to several macros introduced by amendment 1 to ISO C in the header file <iso646.h>, which are keywords in C++.
  • The following functions have changes in their declarations related to the constness of their parameters: strchr, strpbrk, strrchr, strstr, memchr.
  • The functions atexit, exit and abort, defined in <cstdlib> have additions to their behavior in C++.
  • Overloaded versions of some functions are provided with additional types as parameters and the same semantics, like float and long double versions of the functions in the cmath header file, or long versions for abs and div.

Note on versions

C++ includes the C library as described by the 1990 ISO standard and its amendment #1 (ISO/IEC 9899:1990 and ISO/IEC 9899:1990/DAM 1). Some introductions made in the 1999 ISO standard are not compatible with the C++ standard.

Headers

Amendment 1 to ISO-C 90 added two additional headers: cwchar and cwctype.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值