c++中常用头文件及其用途

liuzhenpolestar 2009-03-07 10:25:28
visual c++中要用到头文件,但我不知道vc中都可用哪些头文件,和各有什么作用,所以请各位帮忙
...全文
4193 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zlx1941 2010-04-24
  • 打赏
  • 举报
回复
hao
liuzhenpolestar 2009-10-12
  • 打赏
  • 举报
回复
谢谢大家热心帮忙
T技术沙龙 2009-03-19
  • 打赏
  • 举报
回复
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>

usingnamespacestd;

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

C99增加

#include<complex.h>//复数处理

#include<fenv.h>//浮点环境

#include<inttypes.h>//整数格式转换

#include<stdbool.h>//布尔环境

#include<stdint.h> //整型环境

#include<tgmath.h> //通用类型数学宏
xghuzd 2009-03-19
  • 打赏
  • 举报
回复
VC中.H的都是头文件.
看你要用什么功能了,用到了他的功能你就加了他.H文件

如创建一个MFC程序就在stdafx.h上加了下面这些可能会用到的头文件.
//******************
#include "targetver.h"

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 某些 CString 构造函数将是显式的

// 关闭 MFC 对某些常见但经常可放心忽略的警告消息的隐藏
#define _AFX_ALL_WARNINGS

#include <afxwin.h> // MFC 核心组件和标准组件
#include <afxext.h> // MFC 扩展


#include <afxdisp.h> // MFC 自动化类



#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC 对 Internet Explorer 4 公共控件的支持
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC 对 Windows 公共控件的支持
#endif // _AFX_NO_AFXCMN_SUPPORT
//**************
adetwo 2009-03-19
  • 打赏
  • 举报
回复
iostream 输入输出
iomanip 格式控制
cmath 数学函数
……
TOMWANGCHENGQING 2009-03-13
  • 打赏
  • 举报
回复
iostream iomanip cmath 等等

65,187

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧