C语言中:warning C4133: 'function' :media incompatiblee types - from 'int [3]' to 'co

C语言命语法错误大全_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
文档贡献者
评价文档:
C语言命语法错误大全
大小:2.65KB
登录百度文库,专享文档复制特权,财富值每天免费拿!
你可能喜欢> C语言链表有关问题无情的报错了
C语言链表有关问题无情的报错了
xioafengliang & &
发布时间: & &
浏览:116 & &
回复:3 & &
悬赏:0.0希赛币
C语言链表问题无情的报错了
typedef&struct
struct&list*&
void&main()
list&lst,&a,&b,&c,&*d;
lst.next&=&&a;
a.next&=&&b;
b.next&=&&c;
d&=&lst.next-&//13行
E:\Windows工作区\test3.c(10)&:&warning&C4133:&'='&:&incompatible&types&-&from&'struct&list&*'&to&'struct&list&*'
E:\Windows工作区\test3.c(11)&:&warning&C4133:&'='&:&incompatible&types&-&from&'struct&list&*'&to&'struct&list&*'
E:\Windows工作区\test3.c(12)&:&warning&C4133:&'='&:&incompatible&types&-&from&'struct&list&*'&to&'struct&list&*'
E:\Windows工作区\test3.c(13)&:&error&C2037:&left&of&'next'&specifies&undefined&struct/union&'list'
执行&cl.exe&时出错.
  //定义改成吧
typedef&struct&_list_tags
struct&_list_tags*&
看看这个再写,用理论去实践
xiogxiog & &
& & (0)(0)引用结构体定义的时候少写了一个list,导致struct&list不能识别,应该这样:
  typedef&struct&list
struct&list*&
引用:  typedef&struct
struct&list*&
void&main()
list&lst,&a,&b,&c,&*d;
lst.next&=&&a;
a.next&=&&b;
b.next&=&&c;
d&=&lst.next-&//13行
E:\Windows工作区\test3.c(10)&:&warning&C4133:&'='&:&incompatible&types&-&from&'struct&list&*'&to&'struct&list&*'
E:\Windows工作区\test3.c(11)&:&warning&C4133:&'='&:&incompatible&types&-&from&'struct&list&*'&to&'struct&list&*'
E:\Windows工作区\test3.c(12)&:&warning&C4133:&'='&:&incompatible&types&-&from&'struct&list&*'&to&'struct&list&*'
E:\Windows工作区\test3.c(13)&:&error&C2037:&left&of&'next'&specifies&undefined&struct/union&'list'
执行&cl.exe&时出错.xiong_0075 & &
& & (0)(0)引用楼主的代码编译不通过,d&=&lst.next-&这一句有问题,我把程序修改了一下(基本上只是加了一个&list),如下:
  #include&&stdio.h&
typedef&struct&list
&&&&int&n;
&&&&struct&list&*
int&main()
&&&&list&lst,&a,&b,&c,&*d;
&&&&lst.next&=&&a;
&&&&a.next&=&&b;
&&&&b.next&=&&c;
&&&&d&=&lst.next-&
&&&&return&0;
以上代码codeblocks编译通过
请在定义结构体时加上list,否则IDE会误解&struct&list&*这一句xiogxiog & &
& & (0)(0)引用
本问题标题:
本问题地址:
温馨提示:本问答中心的任何言论仅代表发言者个人的观点,与希赛网立场无关。请对您的言论负责,遵守中华人民共和国有关法律、法规。如果您的言论违反希赛网问答中心的规则,将会被删除。
暂无合适的专家
&&&&&&&&&&&&&&&
希赛网 版权所有 & &&&&湘教QS2-164&&增值电信业务经营许可证湘B2-关于C语言的一个题目_百度知道
关于C语言的一个题目
你好,可以帮我分析下错误吗?#include&stdio.h&int main(){ int c,s; float p,w,d,f; printf(&please enter price,weight,discount:&); scanf(&%f,%f,%d&&p,&w,&s); if(s&=3000)
c=12; else c=s/250; switch(c) { case 0:d=0; case 1:d=2; case 2: case 3:d=5; case 4: case 5: case 6: case 7:d=8; case 8: case 9: case 10: case 11:d=10; case 12:d=15; } f=p*w*s*(1-d/100); printf(&freight=%10.2\n&,f); return 0;}错误为:C:\Users\Pro\Desktop\4.c(7) : error C2296: '&' : illegal, left operand has type 'char [9]'C:\Users\Pro\Desktop\4.c(7) : error C2297: '&' : illegal, right operand has type 'float 'C:\Users\Pro\Desktop\4.c(7) : warning C4133: 'function' : incompatible types - from 'float *' to 'const char *'执行 cl.exe 时出错.可以帮我分析下吗?
提问者采纳
错误信息表示出现了不合法的数据字符&,说明你的编写出了错误在看代码scanf(&%f,%f,%d&&p,&w,&s);,少了个逗号应该是scanf(&%f,%f,%d&,&p,&w,&s);
提问者评价
其他类似问题
为您推荐:
c语言的相关知识
其他1条回答
scanf(&%f,%f,%d&,&p,&w,&s); 添加逗号,低级错误
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁C语言命语法错误大全-你要找的正在找你
C语言命语法错误大全fatalerrorC1004:&unexpectedendoffilefound未找到文件末尾(可能是括号匹配问题)fatalerrorC1021:&invalidpreprocessorcommand'1nclude'无效的编译预处理命令'1nclude'fatalerrorC1083:&Cannotopenincludefile:&'stdi.h':&Nosuchfileordirectory不能打开头文件'stdi.h',文件或文件夹不存在errorC2101:&'&'&onconstant不能计算常量的地址errorC2059:&syntaxerror:&'while'在'while'附近,存在语法错误errorC2061:&syntaxerror:&identifier'x'标识符x的附近,存在语法错误errorC2065:&'i'&:&undeclaredidentifier变量i未定义errorC2078:&toomanyinitializers数组/结构等变量初始化时的数据太多errorC2087:&'&Unknown&'&:&missingsubscript丢失数组下标errorC2106:&'='&:&leftoperandmustbel-value'='的左侧应当是左值,即不能是常量errorC2115:&'='&:&incompatibletypes'='两侧的类型不兼容errorC2133:&'a'&:&unknownsizea(可能是数组名)的大小不确定。errorC2137:&emptycharacterconstant空的字符常量errorC2143:&syntaxerror:&missing';'&before......在......之前,缺少';'errorC2146:&syntaxerror:&missing')'&beforeidentifier'......'在标识符'......'之前缺少')'errorC2181:&illegalelsewithoutmatchingifelse缺少匹配的iferrorC2198:&'printf'&:&toofewactualparameters'printf'函数的参数太少errorC2223:&leftof'-&x'&mustpointtostruct/union'-&x'的左侧应是结构类型变量或联合类型变量errorC2224:&leftof'.x'&musthavestruct/uniontype'.x'的左侧应是结构类型变量或联合类型变量errorC2371:&'f1'&:&redefinition;&differentbasictypes函数'f1'的接口被重定义,参数类型或返回值类型不一致warningC4101:&'x'&:&unreferencedlocalvariable'x'是一个从未被使用的局部变量warningC4013:&'fi'&undefined;&assumingexternreturningint函数'fi'未定义,假设其是外部函数,返回值类型是intwarningC4020:&'fun'&:&toomanyactualparameters调用'fun'函数时,有太多的实参warningC4033:&'f3'&mustreturnavalue函数'f3'应当有返回值语句warningC4047:&'='&:&'int*'&differsinlevelsofindirectionfrom'int'赋值运算中的类型转换:从'int'转换到'int*'可能存在问题warningC4098:&'f2'&:&'void'&functionreturningavalue函数'f2'是无返回值的函数,竟然有返回值语句。warningC4133:&'function'&:&incompatibletypes-&from'...'&to'...'&不兼容的类型转换(从'...'类型向'...'类型)warningC4244:&'initializing'&:&conversionfrom'constdouble'&to'int',&possiblelossofdata在初始化数据时,类型转换可能导致数据丢失warningC4305:&'initializing'&:&truncationfrom'constint'&to'char'初始化时,数据被截断warningC4700:&localvariable'x'&usedwithouthavingbeeninitialized局部变量'x'在被使用之前未初始化,errorLNK2001:&unresolvedexternalsymbol_f5f5从未定义1. Ambiguous operators need parentheses —&不明确的运算需要用括号括起&2. Ambiguous symbol 'xxx'&—&不明确的符号&3. Argument list syntax error —&参数表语法错误&4. Array bounds missing —&丢失数组界限符5. Array size toolarge —&数组尺寸太大6. Bad character in paramenters —&参数中有不适当的字符&7. Bad file name format in include directive —&包含命令中文件名格式不正确&8. Bad ifdef directive synatax —&编译预处理ifdef有语法错&9. Bad undef directive syntax —&编译预处理undef有语法错&10. Bit field too large —&位字段太长&11. Call of non-function —&调用未定义的函数&12. Call to function with no prototype —&调用函数时没有函数的说明&13. Cannot modify a const object —&不允许修改常量对象&14. Case outside of switch —&漏掉了case&语句&15. Case syntax error — Case 语法错误16. Code has no effect —&代码不可能执行到17. Compound statement missing{&—&分程序漏掉&{&&18. Conflicting type modifiers —&不明确的类型说明符&19. Constant expression required —&要求常量表达式&20. Constant out of range in comparison —&在比较中常量超出范围&21. Conversion may lose significant digits —&转换时会丢失意义的数字&22. Conversion of near pointer not allowed —&不允许转换近指针&23. Could not find file 'xxx'&—&找不到XXX文件24. D&—&说明缺少&;&&25. Declaration syntax error —&说明中出现语法错误&26. Default outside of switch — Default 出现在switch语句之外27. Define directive needs an identifier —&定义编译预处理需要标识符&28. Division by zero —&用零作除数&29. Do statement must have while — Do-while语句中缺少while部分&30. Enum syntax error —&枚举类型语法错误&31. Enumeration constant syntax error —&枚举常数语法错误32. Error directive :xxx&—&错误的编译预处理命令&33. Error writing output file —&写输出文件错误&34. Expression syntax error —&表达式语法错误&35. Extra parameter in call —&调用时出现多余错误&36. File name too long —&文件名太长&37. Function call missing )&—&函数调用缺少右括号&38. Fuction definition out of place —&函数定义位置错误&39. Fuction should return a value —&函数必需返回一个值&40. Goto statement missing label — Goto语句没有标号&41. Hexadecimal or octal constant too large — 16进制或8进制常数太大42. Illegal character 'x'&—&非法字符x&43. Illegal initialization —&非法的初始化&44. Illegal octal digit —&非法的8进制数字&45. Illegal pointer subtraction —&非法的指针相减&46. Illegal structure operation —&非法的结构体操作&47. Illegal use of floating point —&非法的浮点运算&48. Illegal use of pointer —&指针使用非法&49. Improper use of a typedefsymbol —&类型定义符号使用不恰当50. In-line assembly not allowed —&不允许使用行间汇编&51. Incompatible storage class —&存储类别不相容&52. Incompatible type conversion —&不相容的类型转换&53. Incorrect number format —&错误的数据格式&54. Incorrect use of default — Default使用不当&55. Invalid indirection —&无效的间接运算&56. Invalid pointer addition —&指针相加无效&57. Irreducible expression tree —&无法执行的表达式运算&58. Lvalue required —&需要逻辑值0或非0值&59. Macro argument syntax error —&宏参数语法错误&60. Macro expansion too long —&宏的扩展以后太长&61. Mismatched number of parameters in definition —&定义中参数个数不匹配62. Misplaced break —&此处不应出现break语句&63. Misplaced continue —&此处不应出现continue语句&64. Misplaced decimal point —&此处不应出现小数点&65. Misplaced elif directive —&不应编译预处理elif&66. Misplaced else —&此处不应出现else&67. Misplaced else directive —&此处不应出现编译预处理else68. Misplaced endif directive —&此处不应出现编译预处理endif&69. Must be addressable —&必须是可以编址的&70. Must take address of memory location —&必须存储定位的地址71. No declaration for function 'xxx'&—&没有函数xxx的说明&72. No stack —&缺少堆栈&73. No type information —&没有类型信息74. Non-portable pointer assignment —&不可移动的指针(地址常数)赋值75. Non-portable pointer comparison —&不可移动的指针(地址常数)比较&76. Non-portable pointer conversion —&不可移动的指针(地址常数)转换&77. Not a valid expression format type —&不合法的表达式格式&78. Not an allowed type —&不允许使用的类型&79. Numeric constant too large —&数值常太大&80. Out of memory —&内存不够用&81. Parameter 'xxx' is never used —&能数xxx没有用到82. Pointer required on left side of -&&—&符号-&的左边必须是指针83. Possible use of 'xxx' before definition —&在定义之前就使用了xxx(警告)&84. Possibly incorrect assignment —&赋值可能不正确&85. Redeclaration of 'xxx'&—&重复定义了xxx&86. Redefinition of 'xxx' is not identical — xxx的两次定义不一致87. Register allocation failure —&寄存器定址失败&88. Repeat count needs an lvalue —&重复计数需要逻辑值&89. Size of structure or array not known —&结构体或数给大小不确定&90. S&—&语句后缺少&;&&91. Structure or union syntax error —&结构体或联合体语法错误92. Structure size too large —&结构体尺寸太大&93. Sub scripting missing ]&—&下标缺少右方括号&94. Superfluous & with function or array —&函数或数组中有多余的&&&95. Suspicious pointer conversion —&可疑的指针转换&96. Symbol limit exceeded —&符号超限&97. Too few parameters in call —&函数调用时的实参少于函数的参数不98. Too many default cases — Default太多(switch语句中一个)&99. Too many error or warning messages —&错误或警告信息太多&100. Too many type in declaration —&说明中类型太多&101. Too much auto memory in function —&函数用到的局部存储太多&102. Too much global data defined in file —&文件中全局数据太多&103. Two consecutive dots —&两个连续的句点&104. Type mismatch in parameter xxx —&参数xxx类型不匹配&105. Type mismatch in redeclaration of 'xxx'&— xxx重定义的类型不匹配&106. Unable to create output file 'xxx'&—&无法建立输出文件xxx&107. Unable to open include file 'xxx'&—&无法打开被包含的文件xxx&108. Unable to open input file 'xxx'&—&无法打开输入文件xxx&109. Undefined label 'xxx'&—&没有定义的标号xxx&110. Undefined structure 'xxx'&—&没有定义的结构xxx&111. Undefined symbol 'xxx'&—&没有定义的符号xxx&112. Unexpected end of file in comment started on line xxx —&从xxx行开始的注解尚未结束文件不能结束113. Unexpected end of file in conditional started on line xxx —&从xxx&开始的条件语句尚未结束文件不能结束&114. Unknown assemble instruction —&未知的汇编结构&115. Unknown option —&未知的操作&116. Unknown preprocessor directive:&'xxx'&—&不认识的预处理命令xxx117. Unreachable code —&无路可达的代码&118. Unterminated string or character constant —&字符串缺少引号119. User break —&用户强行中断了程序&120. Void functions may not return a value — Void类型的函数不应有返回值&121. Wrong number of arguments —&调用函数的参数数目错&122.&'xxx' not an argument — xxx不是参数&123.&'xxx' not part of structure — xxx不是结构体的一部分124. xxx statement missing (&— xxx语句缺少左括号&125. xxx statement missing )&— xxx语句缺少右括号&126. xx&— xxx缺少分号&127. xxx' declared but never used —&说明了xxx但没有使用&128. xxx' is assigned a value which is never used —&给xxx赋了值但未用过C语言编译错误信息锦集说明:Turbo C 的源程序错误分为三种类型:致命错误、一般错误和警告。其中,致命错误通常是内部编译出错;一般错误指程序的语法错误、磁盘或内存存取错误或命令行错误等;警告则只是指出一些得怀疑的情况,它并不防止编译的进行。  下面按字母顺序A~Z分别列出致命错误及一般错误信息,英汉对照及处理方法:(一)、致命错误英汉对照及处理方法:A-B致命错误Bad call of in-line function (内部函数非法调用)分析与处理:在使用一个宏定义的内部函数时,没能正确调用。一个内部函数以两个下划线(__)开始和结束。Irreducable expression tree (不可约表达式树)分析与处理:这种错误指的是文件行中的表达式太复杂,使得代码生成程序无法为它生成代码。这种表达式必须避免使用。Register allocation failure (存储器分配失败)分析与处理:这种错误指的是文件行中的表达式太复杂,代码生成程序无法为它生成代码。此时应简化这种繁杂的表达式或干脆避免使用它。(二)、一般错误信息英汉照及处理方法#operator not followed by maco argument name(#运算符后没跟宏变元名)分析与处理:在宏定义中,#用于标识一宏变串。“#”号后必须跟一个宏变元名。’xxxxxx’ not anargument (’xxxxxx’不是函数参数)分析与处理:在源程序中将该标识符定义为一个函数参数,但此标识符没有在函数中出现。Ambiguous symbol ’xxxxxx’&(二义性符号’xxxxxx’)分析与处理:两个或多个结构的某一域名相同,但具有的偏移、类型不同。在变量或表达式中引用该域而未带结构名时,会产生二义性,此时需修改某个域名或在引用时加上结构名。Argument # missing name (参数#名丢失)分析与处理:参数名已脱离用于定义函数的函数原型。如果函数以原型定义,该函数必须包含所有的参数名。Argument list syntax error (参数表出现语法错误)分析与处理:函数调用的参数间必须以逗号隔开,并以一个右括号结束。若源文件中含有一个其后不是逗号也不是右括号的参数,则出错。Array bounds missing (数组的界限符&]&丢失)分析与处理:在源文件中定义了一个数组,但此数组没有以下右方括号结束。Array size too large (数组太大)分析与处理:定义的数组太大,超过了可用内存空间。Assembler statement too long (汇编语句太长)分析与处理:内部汇编语句最长不能超过480字节。Bad configuration file (配置文件不正确)分析与处理:TURBOC.CFG配置文件中包含的不是合适命令行选择项的非注解文字。配置文件命令选择项必须以一个短横线开始。Bad file name format in include directive(包含指令中文件名格式不正确)分析与处理:包含文件名必须用引号(&filename.h&)或尖括号(&filename&)括起来,否则将产生本类错误。如果使用了宏,则产生的扩展文本也不正确,因为无引号没办法识别。Bad ifdef directive syntax (ifdef指令语法错误)分析与处理:#ifdef必须以单个标识符(只此一个)作为该指令的体。Bad ifndef directive syntax (ifndef指令语法错误)分析与处理:#ifndef 必须以单个标识符(只此一个)作为该指令的体。Bad undef directive syntax (undef指令语法错误)分析与处理:#undef指令必须以单个标识符(只此一个)作为该指令的体。Bad file size syntax (位字段长语法错误)分析与处理:一个位字段长必须是1—16位的常量表达式。Call of non-functin (调用未定义函数)分析与处理:正被调用的函数无定义,通常是由于不正确的函数声明或函数名拼错而造成。Cannot modify a const object (不能修改一个长量对象)分析与处理:对定义为常量的对象进行不合法操作(如常量赋值)引起本错误。Case outside of switch (Case&出现在switch外)分析与处理:编译程序发现Case语句出现在switch语句之外,这类故障通常是由于括号不匹配造成的。Case statement missing (Case语句漏掉)分析与处理:Case语必须包含一个以冒号结束的常量表达式,如果漏了冒号或在冒号前多了其它符号,则会出现此类错误。Character constant too long (字符常量太长)分析与处理:字符常量的长度通常只能是一个或两个字符长,超过此长度则会出现这种错误。Compound statement missing (漏掉复合语句)分析与处理:编译程序扫描到源文件未时,未发现结束符号(大括号),此类故障通常是由于大括号不匹配所致。Conflicting type modifiers (类型修饰符冲突)分析与处理:对同一指针,只能指定一种变址修饰符(如near 或far);而对于同一函数,也只能给出一种语言修饰符(如Cdecl、pascal或interrupt)。&
很喜欢此文字
转载了此文字C语言错误大全_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
C语言错误大全
C​语​言
阅读已结束,如果下载本文需要使用
想免费下载本文?
你可能喜欢

我要回帖

更多关于 incompatible types 的文章

 

随机推荐