1003. Emergency (25)(C语言)
- 格式:doc
- 大小:28.00 KB
- 文档页数:3
常数中有换行符字符串常数不能继续到第二行,除非进行下列操作:•用反斜杠结束第一行。
・用一个双引号结束第一行上的字符串,并在下一行用另一个双引号开始该字符串。
编译器错误C2002错误消息无效的宽字符常数多字节字符常数是非法的。
通过检查下面的可能原因进行修复1.宽字符常数包含的字节比需要的多。
2.未包括标准头文件STDDEF.h。
3.宽字符不能与一般字符串连接。
4.宽字符常数之前必须是字符“L”:编译器错误C2003错误消息应输入'(6行口6~ id”标识符必须跟在预处理器关键字之后。
编译器错误C2004错误消息应为“defined(id)”标识符必须出现在预处理器关键字之后的括号中。
也可能由于为Visual Studio .NET 2003进行的编译器一致性工作生成此错误:在预处理器指令中缺少括号。
如果预处理器指令缺少右括号,则编译器将生成一个错误。
编译器错误C2005错误消息#line应跟一个行号,却找到“token”#line指令后面必须跟行号。
编译器错误C2006错误消息“directive〃应输入文件名,却找到“token”诸如#include或#import等指令需要文件名。
若要解决该错误,请确保token是一个有效文件名。
并且将该文件名放在双引号或尖括号中。
编译器错误C2007错误消息#define 语法#define后未出现标识符。
若要解决该错误,请使用标识符。
编译器错误C2008 错误消息“character”:宏定义中的意外该字符紧跟在宏名之后。
若要解决该错误,宏名之后必须有一个空格。
编译器错误C2009 错误消息宏形式“identifier〃重复使用宏定义的形参表多次使用该标识符。
宏的参数列表中的标识符必须是唯一的。
“character”:宏形参表中的意外该字符在宏定义的形参表中使用不正确。
移除该字符以解决该错误。
编译器错误C2011 错误消息“identifier”:“type” 类型重定义该标识符已定义为type类型。
C语言基础-符号、指令表姓名:[张魏]联系电话:[10086] 联系地址:[中州大学]auto :声明自动变量一般不使用double :声明双精度变量或函数int:声明整型变量或函数struct:声明结构体变量或函数break:跳出当前循环else :条件语句否定分支(与 if 连用)long :声明长整型变量或函数switch :用于开关语句case:开关语句分支enum :声明枚举类型register:声明积存器变量typedef:用以给数据类型取别名(当然还有其他作用)char :声明字符型变量或函数extern:声明变量是在其他文件正声明(也可以看做是引用变量)return :子程序返回语句(可以带参数,也看不带参数)union:声明联合数据类型const :声明只读变量float:声明浮点型变量或函数short :声明短整型变量或函数unsigned:声明无符号类型变量或函数continue:结束当前循环,开始下一轮循环for:一种循环语句(可意会不可言传)signed:生命有符号类型变量或函数gotodoif注解://—单行注解;/*多行注解*/typedef struct{数据类型变量序列1;数据类型变量序列1;...}自定义数据类型的名称;保留字_a t_,a l i e n,b d a t a,b r e a k,b i t,c a s e,c h a r,c o d e,c o m p a c t,c o n s t,c o n t i n u e,d a t a,d e f a u l t,d o,d o u b l e,f a r,e l s e,e n u m,e x t e r n,f l o a t,f o r,g o t o,i f,f u n c u s e d,i d a t a,i n t,i n l i n e,i n t e r r u p t,l a r g e,l o n g,p d a t a,_p r i o r i t y_,r e e n t r a n t,r e t u r n,s b i t,s f r,s f r16,s h o r t,s i g e n d,s i z e o f,s m a l l,s t a t i c,s t r u c t,s w i t c h c_t a s k_,t y p e d e f,u s i n g, u n i o n,u n s i g n e d,v o i d,v o l a t i l e,w h i l e,x d a t a常量表示法※比较运算结果是个布尔值既T R U E(真值)或FA L S E(假值)。
C语言错误提示Ambiguous operators need parentheses -------不明确的运算需要用括号括起Ambiguous symbol ''xxx'' ---------------- 不明确的符号Argument list syntax error ---------------- 参数表语法错误Array bounds missing ------------------ 扔掉数组界限符Array size toolarge ----------------- 数组尺寸太大 Bad character in paramenters ------ ------------ 参数中有不合适的字符Bad file name format in include directive ------------ 包含命令中文件名格式不正确Bad ifdef directive synatax ------------------ 编译预办理 ifdef 有语法错Bad undef directive syntax ------------------- 编译预办理 undef 有语法错Bit field too large ---------------- 位字段太长Call of non-function ----------------- 调用不决义的函数Call to function with no prototype ----------- 调用函数时没有函数的说明Cannot modify a const object ---------------不一样意修改常量对象Case outside of switch ----------------遗漏了 case语句Case syntax error ------------------ Case 语法错误 Code has no effect ----------------- 代码不能述不能能执行到Compound statement missing{ -------------------- 分程序遗漏 "{"Conflicting type modifiers ------------------ 不明确的种类说明符Constant expression required ----------------要求常量表达式Constant out of range in comparison --------------在比较中常量超出范围Conversion may lose significant digits ---------变换时会扔掉意义的数字Conversion of near pointer not allowed ---------------不一样意变换近指针Could not find file ''xxx'' -----------------------找不到XXX文件Declaration missing ; ---------------- 说明缺少 " ; " Declaration syntax error ----------- ------ 说明中出现语法错误Default outside of switch -------------- Default 出现在 switch 语句之外Define directive needs an identifier ---------定义编译预办理需要表记符Division by zero ------------------ 用零作除数Do statement must have while ----------- Do-while 语句中缺少 while 部分Enum syntax error --------------------- 列举种类语法错误Enumeration constant syntax error -----------------列举常数语法错误Error directive :xxx ------------------------ 错误的编译预办理命令Error writing output file ---------------------写输出文件错误Expression syntax error ----------------------- 表达式语法错误Extra parameter in call ------------------------ 调用时出现节余错误File name too long ---------------- 文件名太长Function call missing ----------------- 函数调用缺少右括号Fuction definition out of place ------------------ 函数定义地址错误Fuction should return a value ------------------函数必需返回一个值Goto statement missing label ------------------ Goto 语句没有标号Hexadecimal or octal constant too large -------16进制或 8 进制常数太大Illegal character ''x'' ------------------ 非法字符 x Illegal initialization ------------------ 非法的初始化Illegal octal digit ------------------ 非法的 8 进制数字Illegal pointer subtraction ------------------ 非法的指针相减Illegal structure operation ------------------ 非法的结构体操作Illegal use of floating point ----------------- 非法的浮点运算Illegal use of pointer -------------------- 指针使用非法Improper use of a typedefsymbol ----------------种类定义符号使用不合适In-line assembly not allowed ----------------- 不一样意使用行间汇编Incompatible storage class -----------------储藏种类不相容Incompatible type conversion -------------------- 不相容的种类变换Incorrect number format ----------------------- 错误的数据格式Incorrect use of default --------------------- Default 使用不当Invalid indirection --------------------- 无效的间接运算Invalid pointer addition ------------------ 指针相加无效Irreducible expression tree --------------------- 无法执行的表达式运算Lvalue required --------------------------- 需要逻辑值 0 或非 0 值Macro argument syntax error ------------------- 宏参数语法错误Macro expansion too long ---------------------- 宏的扩展今后太长Mismatched number of parameters in definition ----定义中参数个数不般配Misplaced break --------------------- 此处不应出现 break 语句Misplaced continue ------------------------ 此处不应出现 continue 语句Misplaced decimal point -------------------- 此处不应出现小数点Misplaced elif directive -------------------- 不应编译预办理 elifMisplaced else ---------------------- 此处不应出现 elseMisplaced else directive ------------------ 此处不应出现编译预办理elseMisplaced endif directive ----------------- 此处不应出现编译预办理endifMust be addressable ----------------------必定是能够编址的Must take address of memory location ---------------必定储藏定位的地址No declaration for function ''xxx'' ---------------- 没有函数 xxx 的说明No stack --------------- 缺少货仓No type information ------------------ 没有种类信息Non-portable pointer assignment -------- 不能搬动的指针(地址常数赋值Non-portable pointer comparison --------不能搬动的指针 (地址常数比较Non-portable pointer conversion --------不能搬动的指针(地址常数变换Not a valid expression format type ----------------- 不合法的表达式格式Not an allowed type --------------------- 不一样意使用的种类Numeric constant too large ------------------- 数值常太大Out of memory ------------------- 内存不够用 Parameter ''xxx'' is never used ----------- ------- 能数 xxx 没适用到Pointer required on left side of -> ------------符号->的左边必定是指针Possible use of ''xxx'' before definition ----------在定义从前就使用了xxx ( 警告Possibly incorrect assignment ----------------赋值可能不正确Redeclaration of ''xxx'' ------------------- 重复定义了 xxxRedefinition of ''xxx'' is not identical -------- xxx 的两次定义不一致Register allocation failure ------------------ 寄存器定址失败Repeat count needs an lvalue ------------------重复计数需要逻辑值Size of structure or array not known -----------结构体或数给大小不确定Statement missing ; ------------------语句后缺少 " ; " Structure or union syntax error -------------- 结构体或联合体语法错误Structure size too large ----------------结构体尺寸太大Sub scripting missing ] ---------------- 下标缺少右方括号Superfluous & with function or array ----------- 函数或数组中有节余的"&"Suspicious pointer conversion --------------------- 可疑的指针变换Symbol limit exceeded --------------- 符号超限Too few parameters in call -----------函数调用时的实参少于函数的参数不Too many default cases ----------------- Default 太多 (switch 语句中一个Too many error or warning messages -----------------错误或警告信息太多Too many type in declaration ----------------- 说明中种类太多Too much auto memory in function --------------- 函数用到的局部储藏太多Too much global data defined in file --------------- 文件中全局数据太多Two consecutive dots ----------------- 两个连续的句点Type mismatch in parameter xxx ---------------- 参数 xxx 种类不般配Type mismatch in redeclaration of ''xxx'' ----- xxx 重定义的种类不般配Unable to create output file ''xxx'' -------------- 无法建立输出文件xxxUnable to open include file ''xxx'' ----------- 无法打开被包含的文件xxxUnable to open input file ''xxx'' ---------------- 无法打开输入文件xxxUndefined label ''xxx'' ------------------- 没有定义的标号 xxxUndefined structure ''xxx'' ----------------- 没有定义的结构 xxxUndefined symbol ''xxx'' ----------------- 没有定义的符号 xxxUnexpected end of file in comment started on line xxx:从 xxx 行开始的解说还没有结束文件不能够结束Unexpected end of file in conditional started on line xxx :从 xxx 开始的条件语句还没有结束文件不能够结束Unknown assemble instruction ----------------未知的汇编结构Unknown option --------------- 未知的操作Unknown preprocessor directive: ''xxx'' ---------不认识的预办理命令xxxUnreachable code ------------------无路可达的代码Unterminated string or character constant------------- 字符串缺少引号User break ---------------- 用户强行中断了程序Void functions may not return a value ---- Void 种类的函数不应有返回值Wrong number of arguments -----------------调用函数的参数数目错''xxx'' not an argument ----------------- xxx 不是参数''xxx'' not part of structure ----------------- xxx 不是结构体的一部分xxx statement missing ( -------------------- xxx 语句缺少左括号xxx statement missing ------------------ xxx 语句缺少右括号xxx statement missing ; -------------------- xxx 缺少分号xxx'' declared but never used -------------------说了然 xxx 但没有使用xxx'' is assigned a value which is never used ----给 xxx 赋了值但未用过Zero length structure ------------------ 结构体的长度为零警告类错误1‘ XXX’ declare but never used变量 XXX 已定义但从未用过。
c语言一到一百的代码基础C语言是计算机科学中非常重要的一门语言,它能够为程序员提供非常强大的功能和灵活性。
想要精通C语言,需要一个详尽的代码基础。
本文将为您介绍如何从一到一百建立C语言代码基础。
一、基础语法1.1 C语言的注释方式注释方式 // 单行注释或/* 多行注释 */。
1.2 C语言的变量定义和基本运算变量定义:type name; 基本运算:四则运算和赋值操作符。
1.3 C语言的控制流程语句if-else语句、for循环语句、while循环语句、do-while循环语句、switch-case语句、break语句和continue语句等。
1.4 C语言的函数定义和调用函数的定义:type function_name(arguments){...}。
调用函数:function_name(arguments)。
二、指针与数组2.1 指针的概念和使用方法指针是一个变量,存储内存地址并允许程序直接访问该地址内存中的值。
指针的使用方法:*p表示指向p所指向的地址的值,&variable表示变量variable的地址。
2.2 数组的定义和使用方法数组是一组同类型的数据,用一个名字和下标来表示。
数组的定义方法:type array_name[size]。
数组的使用方法:array_name[index]。
三、文件操作3.1 文件的打开和关闭打开文件:fopen(filename, mode)。
关闭文件:fclose(file_pointer)。
3.2 文件的读写操作读文件:fscanf(file_pointer, format, arguments),fgets(buffer, size, file_pointer), fread(pointer, size, count, file_pointer)。
写文件:fprintf(file_pointer, format, arguments), fputs(string, file_pointer)。
C语言常见错误提示信息的英汉对照常见错误提示信息的英汉对照Ambiguous operators need parentheses : 不明确的运算需要用括号括起Ambiguous symbol ’xxx’ : 不明确的符号Argument list syntax error : 参数表语法错误Array bounds missing : 丢失数组界限符Array size toolarge : 数组尺寸太大Bad character in paramenters :参数中有不适当的字符Bad file name format in include directive :包含命令中文件名格式不正确Bad ifdef directive synatax :编译预处理ifdef有语法错Bad undef directive syntax :编译预处理undef有语法错Bit field too large :位字段太长Call of non-function :调用未定义的函数Call to function with no prototype :调用函数时没有函数的说明Cannot modify a const object :不允许修改常量对象Case outside of switch: 漏掉了case 语句Case syntax error :Case 语法错误Code has no effect 代码不可述不可能执行到Compound statement missing{ 分程序漏掉"{"Conflicting type modifiers 不明确的类型说明符Constant expression required 要求常量表达式Constant out of range in comparison 在比较中常量超出范围Conversion may lose significant digits 转换时会丢失意义的数字Conversion of near pointer not allowed 不允许转换近指针Could not find file ’xxx’ 找不到XXX文件Declaration missing ; 说明缺少";"Declaration syntax error 说明中出现语法错误Default outside of switch Default 出现在switch语句之外Define directive needs an identifier 定义编译预处理需要标识符Division by zero 用零作除数Do statement must have while Do-while语句中缺少while部分Enum syntax error 枚举类型语法错误Enumeration constant syntax error 枚举常数语法错误Error directive :xxx 错误的编译预处理命令Error writing output file 写输出文件错误Expression syntax error 表达式语法错误Extra parameter in call 调用时出现多余错误File name too long 文件名太长Function call missing ) 函数调用缺少右括号Fuction definition out of place 函数定义位置错误Fuction should return a value 函数必需返回一个值Goto statement missing label Goto语句没有标号Hexadecimal or octal constant too large 16进制或8进制常数太大Illegal character ’x’ 非法字符xIllegal initialization 非法的初始化Illegal octal digit 非法的8进制数字Illegal pointer subtraction 非法的指针相减Illegal structure operation 非法的结构体操作Illegal use of floating point 非法的浮点运算Illegal use of pointer 指针使用非法Improper use of a typedefsymbol 类型定义符号使用不恰当In-line assembly not allowed 不允许使用行间汇编Incompatible storage class 存储类别不相容Incompatible type conversion 不相容的类型转换Incorrect number format 错误的数据格式Incorrect use of default Default使用不当Invalid indirection 无效的间接运算Invalid pointer addition 指针相加无效Irreducible expression tree 无法执行的表达式运算Lvalue required 需要逻辑值0或非0值Macro argument syntax error 宏参数语法错误Macro expansion too long 宏的扩展以后太长Mismatched number of parameters in definition 定义中参数个数不匹配Misplaced break 此处不应出现break语句Misplaced continue 此处不应出现continue语句Misplaced decimal point 此处不应出现小数点Misplaced elif directive 不应编译预处理elif Misplaced else 此处不应出现elseMisplaced else directive 此处不应出现编译预处理else Misplaced endif directive 此处不应出现编译预处理endif Must be addressable 必须是可以编址的Must take address of memory location 必须存储定位的地址No declaration for function ’xxx’ 没有函数xxx的说明No stack 缺少堆栈No type information 没有类型信息Non-portable pointer assignment 不可移动的指针(地址常数)赋值Non-portable pointer comparison 不可移动的指针(地址常数)比较Non-portable pointer conversion 不可移动的指针(地址常数)转换Not a valid expression format type 不合法的表达式格式Not an allowed type 不允许使用的类型Numeric constant too large 数值常太大Out of memory 内存不够用Parameter ’xxx’ is never used 能数xxx没有用到Pointer required on left side of -> 符号->的左边必须是指针Possible use of ’xxx’ before definition 在定义之前就使用了xxx(警告)Possibly incorrect assignment 赋值可能不正确Redeclaration of ’xxx’ 重复定义了xxx Redefinition of ’xxx’ is not identical x xx的两次定义不一致Register allocation failure 寄存器定址失败Repeat count needs an lvalue 重复计数需要逻辑值Size of structure or array not known 结构体或数给大小不确定Statement missing ; 语句后缺少";"Structure or union syntax error 结构体或联合体语法错误Structure size too large 结构体尺寸太大Sub scripting missing ] 下标缺少右方括号Superfluous & with function or array 函数或数组中有多余的"&"Suspicious pointer conversion 可疑的指针转换Symbol limit exceeded 符号超限Too few parameters in call 函数调用时的实参少于函数的参数Too many default cases Default太多(switch语句中一个)Too many error or warning messages 错误或警告信息太多Too many type in declaration 说明中类型太多Too much auto memory in function 函数用到的局部存储太多Too much global data defined in file 文件中全局数据太多Two consecutive dots 两个连续的句点Type mismatch in parameter xxx 参数xxx类型不匹配Type mismatch in redeclaration of ’xxx’ xxx重定义的类型不匹配Unable to create output file ’xxx’ 无法建立输出文件xxx Unable to open include file ’xxx’ 无法打开被包含的文件xxx Unable to open input file ’xxx’ 无法打开输入文件xxx Undefined label ’xxx’ 没有定义的标号xxx Undefined structure ’xxx’ 没有定义的结构xxx Undefined symbol ’xxx’ 没有定义的符号xxx Unexpected end of file in comment started on line xxx 从xxx行开始的注解尚未结束文件不能结束Unexpected end of file in conditional started on line xxx 从xxx 开始的条件语句尚未结束文件不能结束Unknown assemble instruction 未知的汇编结构Unknown option 未知的操作Unknown preprocessor directive: ’xxx’ 不认识的预处理命令xxx Unreachable code 无路可达的代码Unterminated string or character constant 字符串缺少引号User break 用户强行中断了程序Void functions may not return a value Void类型的函数不应有返回值Wrong number of arguments :调用函数的参数数目错‘xxx’ not an argument :xxx不是参数‘xxx’ not part o f struc ture xxx不是结构体的一部分xxx statement missing ( xxx语句缺少左括号xxx statement missing ) xxx语句缺少右括号xxx statement missing ; xxx缺少分号xxx’ declared but never used 说明了xxx但没有使用xxx’ is assigned a value which is never used 给xxx赋了值但未用过。
C语言文件操作函数大全1. `fopen`:打开文件```FILE* fopen(const char* filename, const char* mode);```该函数用于打开一个文件,成功打开返回文件指针,打开失败返回`NULL`。
`filename` 是要打开的文件名,`mode` 是打开模式,常用的模式有 "r"(只读)、"w"(可写,若文件不存在则创建新文件)、"a"(追加模式)。
2. `fclose`:关闭文件```int fclose(FILE* stream);```该函数用于关闭一个文件,成功关闭返回0,关闭失败返回 `EOF`。
`stream` 是要关闭的文件指针。
3. `fread`:读取文件内容```size_t fread(void* ptr, size_t size, size_t count, FILE* stream);```该函数从文件中读取内容,存储到指定的内存块。
`ptr` 是指向要读取数据的内存块的指针,`size` 是每个数据项的大小,`count` 是要读取的数据项数目。
4. `fwrite`:写入文件内容```size_t fwrite(const void* ptr, size_t size, size_t count, FILE* stream);```该函数将指定的内存块内容写入文件。
`ptr` 是指向要写入数据的内存块的指针,`size` 是每个数据项的大小,`count` 是要写入的数据项数目。
5. `fgetc`:读取一个字符```int fgetc(FILE* stream);```该函数从文件中读取一个字符,成功读取返回字符对应的整数值,读取失败或到达文件末尾返回`EOF`。
6. `fputc`:写入一个字符```int fputc(int c, FILE* stream);```该函数将一个字符写入文件,成功写入返回写入的字符,写入失败返回`EOF`。
c语言指令大全表解释C语言指令是计算机科学领域中的基础知识,掌握好它们意味着能够进行高效的编码工作。
正因如此,这篇文章将会针对C语言指令大全表进行解释性阐述。
首先,我们需要了解表中不同的分类,包括:控制流、数据类型、函数库、编译指令和预处理指令。
这些分类代表了不同的操作方式和目的,我们需要根据需求选择不同的指令来使用。
接下来,让我们详细介绍一下C语言指令分类的不同之处和应用场景。
控制流指令:包括条件和循环等语句,它们是一些用来控制代码执行流程的代码片段。
例如:· if语句:用于条件判断,如果满足条件,则执行特定代码块。
· while循环语句:重复执行某一段代码,直到满足条件才退出。
· for循环语句:用于迭代一些操作,通常会有一个计数器来控制循环次数。
数据类型指令:C语言支持多种数据类型,我们需要根据实际需求来选择不同的数据类型。
例如:· int类型:用于表示整数值。
· float类型:用于表示浮点数值。
· char类型:用于表示单个字符。
· double类型:用于表示双精度浮点数。
函数库指令:函数库是预先编写好的一些代码片段,方便我们在程序中调用。
例如:· printf()函数:用于输出文字。
· scanf()函数:用于输入数据。
· pow()函数:用于数学运算,求一个数的n次方。
编译指令:用于告诉程序如何编译代码,之后我们可以在程序中使用它们。
例如:· #include指令:用于载入头文件。
· #define指令:用于定义宏。
预处理指令:是在编译代码之前执行的一系列操作。
例如:· #if指令:用于条件编译,根据条件判断是否编译。
· #ifdef指令:用于检查是否定义了某个宏。
在学习和理解这些指令的过程中,我们不仅需要了解每个指令的具体语法和用法,更要深入思考其潜在的含义和应用场景,学会如何灵活选择和使用它们。
c语言error用法-回复C语言Error 用法在C语言编程中,错误处理是一个非常重要且常见的主题。
当程序发生错误时,为了确保程序能够继续运行,我们需要使用错误处理机制。
C语言提供了一些内置的错误处理机制,其中一个重要的机制是通过使用错误码来标识程序中的错误。
1. 错误码的基本概念错误码是一个整数类型的值,用于标识在程序执行过程中发生的错误。
一个错误码通常包含两个方面的信息:错误的类型和错误的具体原因。
C 语言提供了`errno`这个全局变量来保存最近一次发生的错误码。
`errno`的值通常是一个负数,且在标准C库函数中被设置。
可以通过`#include <errno.h>`来包含这个头文件。
2. 错误返回值的用途当一个函数执行失败时,通常会返回一个错误码来指示错误的具体原因。
通过检查返回值,我们可以在程序的后续部分决定如何处理错误。
在C语言中,一个常见的用法是将错误码与一些预定义的常量进行比较,以便更好地理解错误的类型。
3. 错误码的预定义常量C语言提供了一些预定义的常量来表示常见的错误类型。
这些常量通常以`E` 开头,后面紧跟一个大写字母或数字,例如`EACCES` 表示"Permission denied"。
这些常量定义在`errno.h` 头文件中,它们提供了一个易于记忆和跨平台的标准错误码集。
4. 错误处理函数的使用C语言提供了一些用于处理错误的函数,其中一个常用的函数是`perror()`。
这个函数可以根据当前的错误码,在标准错误输出流上输出与`errno` 相关的错误描述信息。
例如,我们可以使用以下代码来输出错误信息:#include <stdio.h>#include <errno.h>int main() {FILE *file = fopen("example.txt", "r");if (file == NULL) {perror("Error");return errno;}fclose(file);return 0;}在上面的代码片段中,我们尝试打开一个不存在的文件。
C语言错误代码及错误信息错误释义error 1: Out of memory 内存溢出error 2: Identifier expected 缺标识符error 3: Unknown identifier 未定义的标识符error 4: Duplicate identifier 重复定义的标识符error 5: Syntax error 语法错误error 6: Error in real constant 实型常量错误error 7: Error in integer constant 整型常量错误error 8: String constant exceeds line 字符串常量超过一行error 10: Unexpected end of file 文件非正常结束error 11: Line too long 行太长error 12: Type identifier expected 未定义的类型标识符error 13: Too many open files 打开文件太多error 14: Invalid file name 无效的文件名error 15: File not found 文件未找到error 16: Disk full 磁盘满error 17: Invalid compiler directive 无效的编译命令error 18: Too many files 文件太多error 19: Undefined type in pointer def 指针定义中未定义类型error 20: Variable identifier expected 缺变量标识符error 21: Error in type 类型错误error 22: Structure too large 结构类型太长error 23: Set base type out of range 集合基类型越界error 24: File components may not be files or objectsfile分量不能是文件或对象error 25: Invalid string length 无效的字符串长度error 26: Type mismatch 类型不匹配error 27:error 27:Invalid subrange base type 无效的子界基类型error 28:Lower bound greater than upper bound 下界超过上界error 29:Ordinal type expected 缺有序类型error 30:Integer constant expected 缺整型常量error 31:Constant expected 缺常量error 32:Integer or real constant expected 缺整型或实型常量error 33:Pointer Type identifier expected 缺指针类型标识符error 34:Invalid function result type 无效的函数结果类型error 35:Label identifier expected 缺标号标识符error 36:BEGIN expected 缺BEGINerror 37:END expected 缺ENDerror 38:Integer expression expected 缺整型表达式error 39:Ordinal expression expected 缺有序类型表达式error 40:Boolean expression expected 缺布尔表达式error 41:Operand types do not match 操作数类型不匹配error 42:Error in expression 表达式错误error 43:Illegal assignment 非法赋值error 44:Field identifier expected 缺域标识符error 45:Object file too large 目标文件太大error 46:Undefined external 未定义的外部过程与函数error 47:Invalid object file record 无效的OBJ文件格式error 48:Code segment too large 代码段太长error 49:Data segment too large 数据段太长error 50:DO expected 缺DOerror 51:Invalid PUBLIC definition 无效的PUBLIC定义error 52:Invalid EXTRN definition 无效的EXTRN定义error 53: Too many EXTRN definitions 太多的EXTRN定义error 54:OF expected 缺OFerror 55:INTERFACE expected 缺INTERFACEerror 56:Invalid relocatable reference 无效的可重定位引用error 57:THEN expected 缺THENerror 58:TO or DOWNTO expected 缺TO或DOWNTO error 59:Undefined forward 提前引用未经定义的说明error 61:Invalid typecast 无效的类型转换error 62:Division by zero 被零除error 63:Invalid file type 无效的文件类型error 64:Cannot read or write variables of this type 不能读写此类型变量error 65:Pointer variable expected 缺指针类型变量error 66:String variable expected 缺字符串变量error 67:String expression expected 缺字符串表达式error 68:Circular unit reference 单元UNIT部件循环引用error 69:Unit name mismatch 单元名不匹配error 70:Unit version mismatch 单元版本不匹配error 71:Internal stack overflow 内部堆栈溢出error 72:Unit file format error 单元文件格式错误error 73:IMPLEMENTATION expected 缺IMPLEMENTATIONerror 74:Constant and case types do not match 常量和CASE类型不匹配error 75:Record or object variable expected 缺记录或对象变量error 76:Constant out of range 常量越界error 77:File variable expected 缺文件变量error 78:Pointer expression expected 缺指针表达式error 79:Integer or real expression expected 缺整型或实型表达式error 80:Label not within current block 标号不在当前块内error 81:Label already defined 标号已定义error 82:Undefined label in preceding statement part 在前面未定义标号error 83:Invalid @ argument 无效的@参数error 84:UNIT expected 缺UNITerror 85: ";" expected 缺“;”error 86:":" expected 缺“:”error 87:"," expected 缺“,”error 88:"(" expected 缺“(”error 89:")" expected 缺“)”error 90:"=" expected 缺“=”error 91:":=" expected 缺“:=”error 92:"[" or "(." Expected 缺“[”或“(.”error 93: "]" or ".)" expected 缺“]”或“.)”error 94:"." expected 缺“.”error 95: ".." expected 缺“..”error 96:Too many variables 变量太多error 97:Invalid FOR control variable 无效的FOR循环控制变量error 98:Integer variable expected 缺整型变量error 99:Files and procedure types are not allowed here 该处不允许文件和过程类型error 100:String length mismatch 字符串长度不匹配error 101:Invalid ordering of fields 无效域顺序error 102:String constant expected 缺字符串常量error 103:Integer or real variable expected 缺整型或实型变量error 104:Ordinal variable expected 缺有序类型变量error 105:INLINE error INLINE错误error 106:Character expression expected 缺字符表达式error 107:Too many relocation items 重定位项太多error 108:Overflow in arithmetic operation 算术运算溢出error 112:CASE constant out of range CASE常量越界error 113:Error in statement 表达式错误error 114:Cannot call an interrupt procedure 不能调用中断过程error 116:Must be in 8087 mode to compile this 必须在8087模式编译error 117:Target address not found 找不到目标地址error 118:Include files are not allowed here 该处不允许INCLUDE文件error 119:No inherited methods are accessible here 该处继承方法不可访问error 121:Invalid qualifier 无效的限定符error 122:Invalid variable reference 无效的变量引用error 123:Too many symbols 符号太多error 124:Statement part too large 语句体太长error 126:Files must be var parameters 文件必须是变量形参error 127:Too many conditional symbols 条件符号太多error 128:Misplaced conditional directive 条件指令错位error 129:ENDIF directive missing 缺ENDIF指令error 130:Error in initial conditional defines 初始条件定义错误error 131:Header does not match previous definition 和前面定义的过程或函数不匹配error 133:Cannot evaluate this expression 不能计算该表达式error 134:Expression incorrectly terminated 表达式错误结束error 135:Invalid format specifier 无效格式说明符error 136:Invalid indirect reference 无效的间接引用error 137:Structured variables are not allowed here 该处不允许结构变量error 138:Cannot evaluate without System unit 没有System单元不能计算error 139:Cannot access this symbol 不能存取符号error 140:Invalid floating point operation 无效的符号运算error 141:Cannot compile overlays to memory 不能编译覆盖模块至内存error 142:Pointer or procedural variable expected 缺指针或过程变量error 143:Invalid procedure or function reference 无效的过程或函数调用error 144:Cannot overlay this unit 不能覆盖该单元error 146:File access denied 不允许文件访问error 147:Object type expected 缺对象类型error 148:Local object types are not allowed 不允许局部对象类型error 149:VIRTUAL expected 缺VIRTUALerror 150: Method identifier expected 缺方法标识符error 151:Virtual constructors are not allowed 不允许虚构造函数error 152:Constructor identifier expected 缺构造函数标识符error 153:Destructor identifier expected 缺析构函数标识符error 154:Fail only allowed within constructors 只能在构造函数内使用Fail标准过程error 155:Invalid combination of opcode and operands 操作数与操作符无效组合error 156:Memory reference expected 缺内存引用指针error 157:Cannot add or subtract relocatable symbols 不能加减可重定位符号error 158:Invalid register combination 无效寄存器组合error 159:286/287 instructions are not enabled 未激活286/287指令error 160:Invalid symbol reference 无效符号指针error 161:Code generation error 代码生成错误error 162:ASM expected 缺ASMerror 166:Procedure or function identifier expected 缺过程或函数标识符error 167:Cannot export this symbol 不能输出该符号error 168:Duplicate export name 外部文件名重复error 169:Executable file header toerror 170:Too many segments 段太多fatal error C1004: unexpected end of file found 未找到文件末尾(可能是括号匹配问题)fatal error C1021: invalid preprocessor command '1nclude' 无效的编译预处理命令'1nclude' fatal error C1083: Cannot open include file: 'stdi.h': No such file or directory 不能打开头文件'stdi.h',文件或文件夹不存在 error C2101: '&' on constant 不能计算常量的地址error C2059: syntax error : 'while' 在'while'附近,存在语法错误error C2061: syntax error : identifier 'x' 标识符x的附近,存在语法错误 error C2065: 'i' : undeclared identifier 变量i未定义error C2078: too many initializers 数组/结构等变量初始化时的数据太多error C2087: '<Unknown>' : missing subscript 丢失数组下标error C2106: '=' : left operand must be l-value '='的左侧应当是左值,即不能是常量 error C2115: '=' : incompatible types '='两侧的类型不兼容error C2133: 'a' : unknown size a(可能是数组名)的大小不确定。
1003. Emergency (25) As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair of cities are marked on the map. When there is an emergency call to you from some other city, your job is to lead your men to the place as quickly as possible, and at the mean time, call up as many hands on the way as possible.
Input
Each input file contains one test case. For each test case, the first line contains 4 positive integers: N (<= 500) - the number of cities (and the cities are numbered from 0 to N-1), M - the number of roads, C1 and C2 - the cities that you are currently in and that you must save, respectively. The next line contains N integers, where the i-th integer
is the number of rescue teams in the i-th city. Then M lines follow, each describes a road with three integers c1, c2 and L, which are the pair of cities connected by a road and the length of that road, respectively. It is guaranteed
that there exists at least one path from C1 to C2.
Output
For each test case, print in one line two numbers: the number of different shortest paths between C1 and C2, and the maximum amount of rescue teams you can possibly gather.
All the numbers in a line must be separated by exactly one space, and there is no extra space allowed at the end of
a line.
Sample Input
5 6 0 2
1 2 1 5 3
0 1 1
0 2 2
0 3 1
1 2 1
2 4 1
3 4 1
Sample Output
2 4
#include <stdio.h>
int
path[501][501],v[501],vt[501],n,m,c1,c2,max=1000,min,stack[501],s=1,tteams=0,teams=0,count= 0,d[501],td;
void dfs(int x){
int i,j;
for(i=0;i<n;i++){
if(v[i]==0&&path[x][i]!=max){
if(i==c2){
tteams=0;
td=0;
for(j=0;j<s;j++){
tteams+=vt[stack[j]];
if(j!=s-1) td+=path[stack[j]][stack[j+1]];
else td+=path[stack[j]][c2];
}
if(td==d[c2]){
tteams+=vt[c2];
if(teams<tteams) teams=tteams;
count++;
}
}else{
stack[s]=i;
v[i]=1;
s++;
dfs(i);
v[i]=0;
s--;
}
}
}
}
int main(){
int i,j,k,t1,t2,t3;
scanf("%d %d %d %d",&n,&m,&c1,&c2);
if(n==0) scanf("%d",&vt[0]);
for(i=0;i<n;i++){
scanf("%d",&vt[i]);
v[i]=0;
d[i]=max;
for(j=0;j<n;j++){
path[i][j]=max;
}
}
for(i=0;i<m;i++){
scanf("%d %d %d",&t1,&t2,&t3);
path[t1][t2]=path[t2][t1]=t3;
}
d[c1]=0;
for(i=c1;i!=c2;){
min=max;
for(j=0;j<n;j++){
if(v[j]==0&&d[j]<min){
min=d[j];
k=j;
}
}
v[k]=1;
for(j=0;j<n;j++){
if(v[j]==0&&path[k][j]!=max&&d[j]>d[k]+path[k][j]){
d[j]=d[k]+path[k][j];
}
}
i=k;
}
if(c1!=c2){
for(i=0;i<n;i++) v[i]=0;
stack[0]=c1;
v[c1]=1;
dfs(c1);
printf("%d %d\n",count,teams);
}
else printf("1 %d\n",vt[c1]);
return 0;
}。