为什么程序老是出错呢!

来源:百度知道 编辑:UC知道 时间:2024/05/13 04:18:46
我编写了一C++程序编绎老是出错请高手帮忙!小弟谢过了!
程序如下:请点击连接:http://www.programbbs.com/bbs/view20-8079-1.htm
#include <编绎出现的错误如下:
--------------------Configuration: cp-117 - Win32 Debug--------------------
Compiling...
cp-117.cpp
e:\visual\cp-117.cpp(66) : error C2146: syntax error : missing ';' before identifier 'cy'
e:\visual\cp-117.cpp(70) : warning C4305: 'argument' : truncation from 'const double' to 'float'
e:\visual\cp-117.cpp(71) : warning C4305: 'argument' : truncation from 'const double' to 'float'
e:\visual\cp-117.cpp(71) : warning C4305: 'argument' : truncation from 'const double' to 'float'
e:\visual\cp-117.cpp(71) : warning C4305: 'argument' : truncation from 'const double' to 'float'
e

e:\visual\cp-117.cpp(66) : error C2146: syntax error : missing ';' before identifier 'cy'
表示 你定义的cy前面少了个;号, 可能是你的cy的类型系统不认识。

e:\visual\cp-117.cpp(72) : warning C4305: 'argument' : truncation from 'const double' to 'float'
意思是你把const double 转换成float 可能会丢失掉精度,你可以在float变量的前面加上 static_cast<float>,这个是警告,不严重

问题太多了,不好说啊
最多的是warning,实际warning是不影响编译的,光错误就5个

实在太乱了!不好说