初学者最易遇见的六个错误
1:[Error] expression list treated as compound expression in initializer [-fpermissive]
检查该行语句上一行“,”改为“;”
2:[Error] too many initializers for 'char []'
Char被定义了太多,改为指针,char->char*
3:[Error] 'strlen' was not declared in this scope
在发生错误的该源码文件中加入头文件 #include <string.h>
4: [Error] ISO C++ forbids comparison between pointer and integer [-fpermissive]
将”y”-->’y’
5: [Error] 'else' without a previous 'if'
注意括号和标点符号是否匹配
6:当必须重复输出才能显示答案
需要删除scanf后面的“\n”