pta
1.若没有编译错误,也没有值输出来,那么很有可能是陷入了死循环 ——检查循环条件
2.stray ‘\357’ in program.当出现stray时很可能是输入了中文字符——看哪个符号特别一些,它估计就是那个中文字符
3.a.c:(.text.startup+0x92): undefined reference to `OddSum'—对“OddSum”的未定义引用——检查声明与函数定义时名称是否一致,英文字母大小写也要一致哦
4.error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token include<stdio.h>-错误:在“<”标记 include<stdio.h 之前,应为“=”、“”、“;”、“asm”或“__attribute__>——在include<stdio.h>前少了编译预处理命令#
5.此时报错:work.c:15:7: error: invalid suffix "x" on integer constant-整数常量上的后缀“n”无效
y = 2x-1;
^~解决:因为c语言和数学不一样,所以这里应该是2*n少了*啊啊啊啊啊
6.error: ‘else’ without a previous ‘if’——将else和if之间插了东西,如if(){}a=1;else,这中间就将if和else隔开了,导致else前无if
7.利用arm交叉编译器编译一个简单的c程序出现 warning :incompatible implicit declaration of built-in function 'printf'错误——原因是缺少头文件#include <stdio.h>。
8.‘sum’ is used uninitialized in this function——sum没有初始化
- error: invalid operands to binary - (have ‘float’ and ‘int *’) *fracpart=x-intpart;——intpart为指针,应该加上*取出地址中的内容再进行加减