CS2064"术语不评估一个参数的参数#34;?

时间:2015-09-11 23:03:04

标签: c++

我已经看过其他线程,他们说"这或那不是指针!!!"我真的不知道这意味着什么,我已经声明了var,所以这里没有什么工作?我们正在编写一个程序来查找正方形区域,这不是整个代码!第2行也是错误点。

int s = ((line_one + line_two + line_three) / 2);
    int area = sqrt((s - line_one)(s - line_two)(s - line_three));

    cout << "The area of the triange is..." << area << endl;

这里我宣布了其他变量:

// Area of a Triangle

double x1 = 0;
double y1 = 0;
double x2 = 0;
double y2 = 0;
double x3 = 0;
double y3 = 0;
double x4 = 0;
double y4 = 0;
double x5 = 0;
double y5 = 0;
double x6 = 0;
double y6 = 0;

//line one points
cout << "enter point x1" << endl;
cin >> x1;
cout << "enter point y1" << endl;
cin >> y1;
cout << "enter point x2" << endl;
cin >> x2;
cout << "enter point y2" << endl;
cin >> y2;
const int line_one = sqrt((pow((x2 - x1), 2) + (pow((y2 - y1), 2))));

//line two points
cout << "enter point x3" << endl;
cin >> x3;
cout << "enter point y3" << endl;
cin >> y3;
cout << "enter point x4" << endl;
cin >> x4;
cout << "enter point y4" << endl;
cin >> y4;
const int line_two = sqrt((pow((x4 - x3), 2) + (pow((y4 - y3), 2))));

//line three points
cout << "enter point x5" << endl;
cin >> x5;
cout << "enter point y5" << endl;
cin >> y5;
cout << "enter point x6" << endl;
cin >> x6;
cout << "enter point y6" << endl;
cin >> y6;
const int line_three = sqrt((pow((x6 - x5), 2) + (pow((y6 - y5), 2))));
//Calculating the Area

int s = ((line_one + line_two + line_three) / 2);
int area = sqrt((s - line_one)(s - line_two)(s - line_three));

    cout << "The area of the triange is..." << area << endl;


return 0;
}

1 个答案:

答案 0 :(得分:3)

这是一个简单的错误,你忘了在sqrt()函数调用中想要加倍的事物之间添加*。

SELECT * FROM exercises LEFT JOIN sessions on exercises.session_id = sessions.session_id WHERE course_id ='1'
像那样。它给你指针错误,因为它认为你试图调用一个函数,例如,(s - line_one)将返回一个函数指针,(s-line_two)将是该函数的参数。