c run-time library 和 standard c++ library

参考:

c run-time libraries:  http://msdn.microsoft.com/zh-cn/library/vstudio/abx4dbyh(v=vs.100).aspx 

Header Files:http://msdn.microsoft.com/zh-cn/library/vstudio/a7tkse1h(v=vs.100).aspx

c/c++头文件一览:http://blog.csdn.net/jerry0597/article/details/1166285

C/C++头文件一览
C、传统 C++

#include
<assert.h>    //设定插入点
#include
<ctype.h>     //字符处理
#include
<errno.h>     //定义错误码
#include
<float.h>     //浮点数处理
#include <fstream.h>    //文件输入/输出
#include
<iomanip.h>    //参数化输入/输出
#include <iostream.h>   //数据流输入/输出
#include
<limits.h>    //定义各种数据类型最值常量
#include
<locale.h>    //定义本地化函数
#include
<math.h>     //定义数学函数
#include
<stdio.h>     //定义输入/输出函数
#include
<stdlib.h>    //定义杂项函数及内存分配函数
#include
<string.h>    //字符串处理
#include
<strstrea.h>   //基于数组的输入/输出
#include
<time.h>     //定义关于时间的函数
#include
<wchar.h>     //宽字符处理及输入/输出
#include
<wctype.h>    //宽字符分类

//////////////////////////////////////////////////////////////////////////

标准 C++ (同上的不再注释)

#include
<algorithm>    //STL 通用算法
#include
<bitset>     //STL 位集容器
#include
<cctype>
#include <cerrno>
#include
<clocale>
#include <cmath>
#include
<complex>     //复数类
#include
<cstdio>
#include <cstdlib>
#include
<cstring>
#include <ctime>
#include <deque>      //STL 双端队列容器
#include
<exception>    //异常处理类
#include
<fstream>
#include <functional>   //STL 定义运算函数(代替运算符)
#include
<limits>
#include <list>      //STL 线性列表容器
#include
<map>       //STL 映射容器
#include
<iomanip>
#include <ios>       //基本输入/输出支持
#include
<iosfwd>     //输入/输出系统使用的前置声明
#include
<iostream>
#include <istream>     //基本输入流
#include
<ostream>     //基本输出流
#include
<queue>      //STL 队列容器
#include
<set>       //STL 集合容器
#include
<sstream>     //基于字符串的流
#include
<stack>      //STL 堆栈容器    
#include
<stdexcept>    //标准异常类
#include
<streambuf>    //底层输入/输出支持
#include
<string>     //字符串类
#include
<utility>     //STL 通用模板类
#include
<vector>     //STL 动态数组容器
#include
<cwchar>
#include <cwctype>

using namespace std;

//////////////////////////////////////////////////////////////////////////

C99
增加

#include
<complex.h>   //复数处理
#include
<fenv.h>    //浮点环境
#include
<inttypes.h>  //整数格式转换
#include
<stdbool.h>   //布尔环境
#include
<stdint.h>   //整型环境
#include
<tgmath.h>   //通用类型数学宏

以下引用自http://club.topsage.com/thread-2271422-1-1.html

C++中#include包含头文件带 .h 和不带 .h 的区别? 如 #include <iostream> 和 #include <iostream.h> 包含的东西有哪些不同?
之前在写C++程序的时候只知道使用 #include <iostream> 的时候,使用函数前要用 using namespace std; 导入命名空间,而 #include <iostream.h> 则不用,这个得看C++标准化过程为C++开发者做了哪些有意义的工作。
C++标准化过程中,其中一个环节,解决了以下问题:
(1)C++增加了名称空间概念,借以将原来声明在全局空间下的标识符声明在了namespace std下。
(2)统一C++各种后缀名,如.h、.hpp、.hxx等。标准化之前的头文件就是带后缀名的文件,标准化后的头文件就是不带后缀名的文件。C++ 98 规定用户应使用新版头文件,对旧版本头文件不在进行强制规范,但大多数编译器厂商依然提供旧版本头文件,以求向下兼容。
也就是说带 .h 的头文件是旧标准的,如果想用新的标准的头文件就不要带 .h。
另外,为了和C语言兼容,C++标准化过程中,原有C语言头文件标准化后,头文件名前带个c字母,如cstdio、cstring、ctime、ctype等等。这些头文件都可以在 C:Program FilesMicrosoft Visual Studio 10.0VCinclude 这个目录下找到(以VC2010为例)。也就是说,我们如果要用C++标准化了的C语言头文件,就得作如下的转换
#include <stdio.h> --> #include <cstdio> #include <stdlib.h> --> #include <cstdlib> #include <string.h> --> #include <cstring>
还要提及的一点是,我在看C++标准库的时候,看到一个特殊情况 <memory.h> 和 <memory>,这两个头文件是完全不同的,因为我发现 <memory.h>头文件件包含了 <mem.h>;而 <memory> 包含 <memory.stl>
这里摘录 memory.h 中的一段代码:
  1. #if !defined(__cplusplus)
  2. #  include <mem.h>
  3. #else /* __cplusplus */
  4. #  if !defined(__USING_STD_NAMES__)
  5. #    include <mem.h>
  6. #  else /* __USING_STD_NAMES__ */
  7. #    include <memory.stl>
  8. #  endif /* __USING_STD_NAMES__ */
  9. #endif /* __cplusplus */
关于这一点,不知道我理解的是否到位,还请大家多讨论、指点
原文地址:https://www.cnblogs.com/qingxinlangjing/p/3208171.html