初学c编程小错误总结(持续更新中)

1.找不到错误时,可以把该行代码重新输入
2.error:macro names must be identifiers  宏名必须是标识符
3.error: expect ';',',',‘)’before'&'token  c语言无引用,&表示地址
4.error: request for member 'elem' in something not a structure or union   结构体指针要用->来引用成员,  结构体变量成员引用要用  指针.成员名
5.error: unknown type name 'Sqlist'  结构体指针前要加struct(尤其是函数形参)
6.error: unknown type name 'stutas'  单词status输入错误,单词大小写出错
7.error: expected expression before ')' token   ‘)’前的宏为对应常量;宏没有定义相应的值。
8.fatal error: iostream.h: No such file or directory  codeblocks中c程序不兼容,是非标准输入输出流
9.error: invalid type argument of '->' (have 'struct Sqlist')  结构体成员引用符不对
10.undefined reference to `mallloc'  malloc输入错误  
11.warning: passing argument 1 of 'vi' makes pointer from integer without a cast  变量类型问题:函数vi的第一个integer型参数没有强制转化为pointer类型
12 .error: expected expression before 'PNODE         变量定义位置不对,C语言的变量定义放在程序一开始
13中文输出出现乱码问题?
14 error: 'else' without a previous 'if'    ?
15.error: conflicting types for 'pop'     函数声明与函数体矛盾。
16.!!!!分开编译要包含文件名时要有后缀名才可以。
17error: expected primary-expression before '<' token        if语句出现了这样的判断语句:1= 18 error: incompatible type for argument 1 of 'ListLength'       ListLength函数的参数类型出错。
19 error: ld returned 1 exit status     main函数出了问题(main写错)。或者没写main函数。
20 undefined reference to `MwergeList'      MwergeList没定义
21  error: invalid preprocessing directive #inclule    包含命令写错了。
22 !!程序修改后必须保存,才能正常运行。
23.    if(!LocateElem(La,p->data,equal));    该语句是一个无意义的语句,所以一定要注意分号的使用。
24 c++主函数的返回类型必须为int类型。
25.大括号对于程序流的控制十分重要,因此对于出现较多莫名错误时,应对此进行检查。
26.程序无结果输出,很可能是由于出现了死循环。
27scanf函数是个很死板的函数,输入时格式必须严格控制,否则会出错
28error: stray '\241' in program|   标点符号的中英文格式出错。
29note: in expansion of macro 'MAX_TREE_SIZE'   宏MAX_TREE_SIZE'的扩大,实际是在输出该值时,cout使用错误。
30error: expected primary-expression before ')' token   错误语句: if(T[0]==Nil))   多了一个括号
31error: expected unqualified-id before '[' token     定义时使用了:Node [MAX_SIZE];  Node是一个数据类型。
33定义二维字符数组初始化后,用printf的%s控制输出,没有任何输出:输出a[0][0]这样的一个字符要用%c,a[0]这样的字符串输出用%s,分清要输出什么。

34.for语句出错找不到原因时,可以输出控制循环的变量来查看。for语句后紧跟一个分号,是空语句!!

注:有些原因尚未找到。。。

你可能感兴趣的:(#,C基础)