1、C++
#includ e <assert.h> //设定插入点
#includ e <ctype.h> //字符处理
#includ e <errno.h> //定义错误码
#includ e <float.h> //浮点数处理
#includ e <fstrea m.h> //文件输入/输出
#includ e <iomani p.h> //参数化输入/输出
#includ e <iostre am.h> //数据流输入/输出
#includ e <limits.h> //定义各种数据类型最值常量
#includ e <locale.h> //定义本地化函数
#includ e <math.h> //定义数学函数
#includ e <stdio.h> //定义输入/输出函数
#includ e <stdlib.h> //定义杂项函数及内存分配函数
#includ e <string.h> //字符串处理
#includ e <strstr ea.h> //基于数组的输入/输出
#includ e <time.h> //定义关于时间的函数
#includ e <wchar.h> //宽字符处理及输入/输出
#includ e <wctype.h> //宽字符分类
2、标准C++
其中包括的头文件如下(同上的不再注释)
#includ e <algori thm> //STL 通用算法
#includ e <bitset> //STL 位集容器
#includ e <cctype>
#includ e <cerrno>
#includ e <clocal e>
#includ e <cmath>
#includ e <comple x> //复数类
#includ e <cstdio>
#includ e <cstdli b>
#includ e <cstrin g>
#includ e <ctime>
#includ e <deque> //STL 双端队列容器
#includ e <except ion> //异常处理类
#includ e <fstrea m>
#includ e <functi onal> //STL 定义运算函数(代替运算符) string.h(2张)
#includ e <limits>
#includ e <list> //STL 线性列表容器
#includ e <map> //STL 映射容器
#includ e <iomani p>
#includ e <ios> //基本输入/输出支持
#includ e <iosfwd> //输入/输出系统使用的前置声明
#includ e <iostre am>
#includ e <istrea m> //基本输入流
#includ e <ostrea m> //基本输出流
#includ e <queue> //STL 队列容器
#includ e <set> //STL 集合容器
#includ e <sstrea m> //基于字符串的流
#includ e <stack> //STL 堆栈容器
#includ e <stdexc ept> //标准异常类
#includ e <stream buf> //底层输入/输出支持
#includ e <string> //字符串类
#includ e <utilit y> //STL 通用模板类
#includ e <vector> //STL 动态数组容器
#includ e <cwchar>
#includ e <cwctyp e> usingnamesp ace std;
3、C99 增加
#includ e <comple x.h> //复数处理
#includ e <fenv.h> //浮点环境
#includ e <inttyp es.h> //整数格式转换
#includ e <stdboo l.h> //布尔环境
#includ e <stdint.h> //整型环境
#includ e <tgmath.h> //通用类型数学宏
fatalerrorC1003: errorcountexceed s number; stoppi ng compil ation
中文对照:(编译错误)错误太多,停止编译
分析:修改之前的错误,再次编译
fatalerrorC1004: unexpe ctedend of file found
ios 字符串转数组
中文对照:(编译错误)文件未结束
分析:一个函数或者一个结构定义缺少“}”、或者在一个函数调用或表达式中括号没有配对出现、或者注释符“/*…*/”不完整等
fatalerrorC1083: Cannot open includ e file: 'xxx': No such file or direct ory
中文对照:(编译错误)无法打开头文件xxx:没有这个文件或路径
分析:头文件不存在、或者头文件拼写错误、或者文件为只读
fatalerrorC1903: unable to recove r from previo us error(s); stoppi ng compil ation
中文对照:(编译错误)无法从之前的错误中恢复,停止编译
分析:引起错误的原因很多,建议先修改之前的错误
errorC2001: newlin e in consta nt
中文对照:(编译错误)常量中创建新行
分析:字符串常量多行书写
errorC2006: #includ e expect ed a filena me, found'identi fier'
中文对照:(编译错误)#includ e命令中需要文件名
分析:一般是头文件未用一对双引号或尖括号括起来,例如“#includ e stdio.h”
errorC2007: #define syntax
中文对照:(编译错误)#define语法错误
分析:例如“#define”后缺少宏名,例如“#define”
errorC2008: 'xxx' : unexpe ctedin macrodefini tion
中文对照:(编译错误)宏定义时出现了意外的x xx
分析:宏定义时宏名与替换串之间应有空格,例如“#defineTRUE"1"”
errorC2009: reuseof macroformal 'identi fier'
中文对照:(编译错误)带参宏的形式参数重复使用
分析:宏定义如有参数不能重名,例如“#defines(a,a)(a*a)”中参数a重复
errorC2010: 'charac ter' : unexpe ctedin macroformal parame ter list
中文对照:(编译错误)带参宏的形式参数表中出现未知字符
分析:例如“#defines(r|)r*r”中参数多了一个字符…|‟
errorC2014: prepro cesso r comman d must startas firstnonwhi te space
中文对照:(编译错误)预处理命令前面只允许空格
分析:每一条预处理命令都应独占一行,不应出现其他非空格字符
errorC2015: too many charac tersin consta nt
中文对照:(编译错误)常量中包含多个字符
分析:字符型常量的单引号中只能有一个字符,或是以“\”开始的一个转义字符,例如“charerror= 'error';”
errorC2017: illega l escape sequen ce
中文对照:(编译错误)转义字符非法
分析:一般是转义字符位于' ' 或" " 之外,例如“charerror= ' '\n;”
errorC2018: unknow n charac ter '0xhh'
中文对照:(编译错误)未知的字符0xhh
分析:一般是输入了中文标点符号,例如“charerror= 'E';”中“;”为中文标点符号
errorC2019: expect ed prepro cesso r direct ive, found'charac ter'
中文对照:(编译错误)期待预处理命令,但有无效字符
分析:一般是预处理命令的#号后误输入其他无效字符,例如“#!defineTRUE1”
errorC2021: expect ed expone nt value, not 'charac ter'
中文对照:(编译错误)期待指数值,不能是字符
分析:一般是浮点数的指数表示形式有误,例如123.456E
errorC2039: 'identi fier1' : is not a member of 'identi fier2'
中文对照:(编译错误)标识符1不是标识符2的成员
分析:程序错误地调用或引用结构体、共用体、类的成员
errorC2041: illega l digit'x' for base 'n'
中文对照:(编译错误)对于n进制来说数字x非法
分析:一般是八进制或十六进制数表示错误,例如“inti=081;”语句中数字…8‟不是八进制的基数
errorC2048: more than one defaul t
中文对照:(编译错误)defaul t语句多于一个
分析:switch语句中只能有一个de fault,删去多余的d efaul t
errorC2050: switch expres sionnot integr al
中文对照:(编译错误)switch表达式不是整型的
分析:switch表达式必须是整型(或字符型),例如“switch("a")”中表达式为字符串,这是非法的
errorC2051: case expres sionnot consta nt
中文对照:(编译错误)case表达式不是常量
分析:case表达式应为常量表达式,例如“case"a"”中“"a"”为字符串,这是非法的
errorC2052: 'type' : illega l type for case expres sion
中文对照:(编译错误)case表达式类型非法
分析:case表达式必须是一个整型常量(包括字符型)
errorC2057: expect ed consta nt expres sion
中文对照:(编译错误)期待常量表达式
分析:一般是定义数组时数组长度为变量,例如“intn=10;inta[n];”中n为变量,这是非法的
errorC2058: consta nt expres sionis not integr al
中文对照:(编译错误)常量表达式不是整数
分析:一般是定义数组时数组长度不是整型常量
errorC2059: syntax error: 'xxx'
中文对照:(编译错误)…xxx‟语法错误
分析:引起错误的原因很多,可能多加或少加了符号x xx
errorC2064: term does not evalua te to a functi on
中文对照:(编译错误)无法识别函数语言
分析:1、函数参数有误,表达式可能不正确,例如“sqrt(s(s-a)(s-b)(s-c));”中表达式不正确
2、变量与函数重名或该标识符不是函数,例如“inti,j;j=i();”中i不是函数
errorC2065: 'xxx' : undecl aredidenti fier
中文对照:(编译错误)未定义的标识符xxx
分析:1、如果xxx为cout、cin、scanf、printf、sqrt等,则程序中包含头文件有误
2、未定义变量、数组、函数原型等,注意拼写错误或区分大小写。
errorC2078: too many initia lizer s
中文对照:(编译错误)初始值过多
分析:一般是数组初始化时初始值的个数大于数组长度,例如“intb[2]={1,2,3};”
errorC2082: redefi nitio n of formal parame ter 'xxx'
中文对照:(编译错误)重复定义形式参数xxx
分析:函数首部中的形式参数不能在函数体中再次被定义
errorC2084: functi on 'xxx' alread y has a body
中文对照:(编译错误)已定义函数x xx
分析:在VC++早期版本中函数不能重名,6.0版本中支持函数的重载,函数名可以相同但参数不一样
errorC2086: 'xxx' : redefi nitio n
中文对照:(编译错误)标识符xxx重定义
分析:变量名、数组名重名
errorC2087: '<Unknow n>' : missin g subscr ipt
中文对照:(编译错误)下标未知
分析:一般是定义二维数组时未指定第二维的长度,例如“inta[3][];”
errorC2100: illega l indire ction
中文对照:(编译错误)非法的间接访问运算符“*”
分析:对非指针变量使用“*”运算
errorC2105: 'operat or' needsl-value
中文对照:(编译错误)操作符需要左值
分析:例如“(a+b)++;”语句,“++”运算符无效
errorC2106: 'operat or': left operan d must be l-value
中文对照:(编译错误)操作符的左操作数必须是左值
分析:例如“a+b=1;”语句,“=”运算符左值必须为变量,不能是表达式
errorC2110: cannot add two pointe rs
中文对照:(编译错误)两个指针量不能相加
分析:例如“int*pa,*pb,*a;a=pa+pb;”中两个指针变量不能进行“+”运算
errorC2117: 'xxx' : arraybounds overfl ow
中文对照:(编译错误)数组xxx边界溢出
分析:一般是字符数组初始化时字符串长度大于字符数组长度,例如“charstr[4]="abcd";”
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论