一段C++代码,求修改 error C2143: syntax error : missing ';' before 'constant'
答案:4 悬赏:60
解决时间 2021-03-09 02:20
提问者网友:朱砂泪
2021-03-08 18:02
int n=1;< #include< n++#include< output=input/endl; int main() { const double change=35 273;using namespace std;<< } while (output<,output;<< cin>stdlib; cout=1); cout<"
最佳答案
二级知识专家网友:湫止没有不同
2021-03-08 18:16
const double change=35 273.92;
35之后怎么还有一个空格呢?
全部回答
1楼网友:为你轻狂半世殇
2021-03-08 21:24
const double change=35273.92;
去掉数字间的空格
2楼网友:晚安听书人
2021-03-08 20:32
1,运行程序之前的窗口未关闭
2,缺少头文件
3,缺少引导文件
看看你的错误代码是多少,查查这里
最常见的20种vc++编译错误信息
1、fatal error c1010: unexpected end of file while looking for precompiled header directive。
寻找预编译头文件路径时遇到了不该遇到的文件尾。(一般是没有#include "stdafx.h")
2、fatal error c1083: cannot open include file: 'r…….h': no such file or directory
不能打开包含文件“r…….h”:没有这样的文件或目录。
3、error c2011: 'c……': 'class' type redefinition
类“c……”重定义。
4、error c2018: unknown character '0xa3'
不认识的字符'0xa3'。(一般是汉字或中文标点符号)
5、error c2057: expected constant expression
希望是常量表达式。(一般出现在switch语句的case分支中)
6、error c2065: 'idd_mydialog' : undeclared identifier
“idd_mydialog”:未声明过的标识符。
7、error c2082: redefinition of formal parameter 'breset'
函数参数“breset”在函数体中重定义。
8、error c2143: syntax error: missing ':' before '{'
句法错误:“{”前缺少“;”。
9、error c2146: syntax error : missing ';' before identifier 'dc'
句法错误:在“dc”前丢了“;”。
10、error c2196: case value '69' already used
值69已经用过。(一般出现在switch语句的case分支中)
11、error c2509: 'ontimer' : member function not declared in 'chelloview'
成员函数“ontimer”没有在“chelloview”中声明。
12、error c2511: 'reset': overloaded member function 'void (int)' not found in 'b'
重载的函数“void reset(int)”在类“b”中找不到。
13、error c2555: 'b::f1': overriding virtual function differs from 'a::f1' only by return type or calling convention
类b对类a中同名函数f1的重载仅根据返回值或调用约定上的区别。
14、error c2660: 'settimer' : function does not take 2 parameters
“settimer”函数不传递2个参数。
15、warning c4035: 'f……': no return value
“f……”的return语句没有返回值。
16、warning c4553: '= =' : operator has no effect; did you intend '='?
没有效果的运算符“= =”;是否改为“=”?
17、warning c4700: local variable 'breset' used without having been initialized
局部变量“breset”没有初始化就使用。
18、error c4716: 'cmyapp::initinstance' : must return a value
“cmyapp::initinstance”函数必须返回一个值。
19、link : fatal error lnk1168: cannot open debug/p1.exe for writing
连接错误:不能打开p1.exe文件,以改写内容。(一般是p1.exe还在运行,未关闭)
20、error lnk2001: unresolved external symbol "public: virtual _ _thiscall c……::~c……(void)"
连接时发现没有实现的外部符号(变量、函数等)。
3楼网友:努力只為明天
2021-03-08 19:30
#include
//#include
//using namespace std;
int main()
{
const double change=35273.92;
double input,output;
int n=1;
cout<<"please input the weight"<>input;
output=input/change;
cout<<"the output is"<