标题:E:\vc\Cpp1.cpp(51) : error C2064: term does not evaluate to a function ...
只看楼主
贰贰
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2015-1-9
结帖率:0
已结贴  问题点数:10 回复次数:2 
E:\vc\Cpp1.cpp(51) : error C2064: term does not evaluate to a function不知道是什么意思
#include<iostream>
#include<cmath>
using namespace std;
class shape
{
public:
    virtual void printArea()=0;
};
class circle:public shape
{
public:
     circle(float R)
    {
        r=R;};
    void printArea();
private:
    float r;
};
void circle::printArea()
{
    cout<<3.14*r*r<<endl;
};
class rectangle:public shape
{
public:
     rectangle(float x,float y)
    {
        a=x;b=y;
    };
    void printArea();
private:
    float a,b;
};
void rectangle::printArea()
{
    cout<<a*b<<endl;
};
class triangle:public shape
{
public:
     triangle(float x,float y,float z)
    {
        a=x;b=y;c=z;
    };
    void printArea();
private:
    float a,b,c;
};
void triangle::printArea()
{
    cout<<0.25*sqrt(a*a(2*b*b+2*c*c-a*a)-(b*b-c*c)(b*b-c*c))<<endl;

};
void fun(shape *p)
{
    p->printArea();
};
int main()
{
    circle c(2);
    rectangle rec(4,3);
    triangle tri(3,4,5);
    fun(&c);
    fun(&rec);
    fun(&tri);
    return 0;
}
E:\vc\Cpp1.cpp(51) : error C2064: term does not evaluate to a function
请问一下哪里错了呢
搜索更多相关主题的帖子: function private include public 
2015-06-08 23:01
贰贰
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2015-1-9
得分:0 
cout<<0.25*sqrt(a*a(2*b*b+2*c*c-a*a)-(b*b-c*c)(b*b-c*c))<<endl;

这一行是错误提示行
2015-06-08 23:16
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:507
帖 子:8890
专家分:53117
注 册:2011-1-18
得分:10 
a*a(2*b*b+2*c*c-a*a)-(b*b-c*c)(b*b-c*c)
a*a*(2*b*b+2*c*c-a*a)-(b*b-c*c)*(b*b-c*c)
2015-06-09 08:15



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-446368-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.640651 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved