-3
#include <iostream>
using namespace std;
int main()
{
// prototypes:
float add_and_div(float, float, float);
// variables:
float x, y, z;
float result;
cout << "Enter three floats: ";
cin >> x >> y >> z;
// continue the program here
add_and_div(x,y,z,);
当我尝试编译,我得到以下错误信息:语法错误: ')' 1> 1>构建失败。语法错误,我不知道如何纠正C++代码。 (作业项目)
您是否发布了完整的文件? (因为它的main()函数是不完整的,所以不能将其编译为张贴的,因为它的main()函数是不完整的。它有一个开放的大括号,但不是与之匹配的关闭的大括号。) – thb 2012-03-18 22:57:40
'add_and_div(x,y,z,);'< - 有无关的逗号在这里。 – 2012-03-18 22:57:42
'main'函数没有右括号。 – 2012-03-18 23:47:26