| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4349 人关注过本帖
标题:error C2064: term does not evaluate to a function
取消只看楼主 加入收藏
稻草人25
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2016-4-20
结帖率:40%
收藏
已结贴  问题点数:20 回复次数:2 
error C2064: term does not evaluate to a function
#include<iostream>
#include<math.h>
using namespace std;
class Shape
{
public:
    virtual void ShapeName() const=0;
};
class Circle:public Shape
{
public:
    Circle(double r):radius(r){}
    double area(){return(3.14159*radius*radius);}
    virtual void ShapeName() const {cout<<"Circle:";}
    virtual void printArea();
protected:
    double radius;
};
void Circle::printArea()
{cout<<Circle::area()<<endl;}
class Rectangle:public Shape
{
public:
    Rectangle(float l,float w):length(l),width(w){}
    float area(){return length*width;}
    virtual void ShapeName() const {cout<<"Rectangle:";}
    void printArea();
protected:
    float length;
    float width;
};
void Rectangle::printArea()
{cout<<Rectangle::area()<<endl;}
class Triangle:public Shape
{
public:
    Triangle(float x=0,float y=0,float z=0);
    float area()
    {
        float p;
        p=(x+y+z)/2;
        return sqrt(p(p-x)(p-y)(p-z));
    }
    virtual void ShapeName() const {cout<<"Triangle:";}
    void printArea();
protected:
    float x;
    float y;
    float z;
};
void Triangle::printArea()
{cout<<Triangle::area()<<endl;}
int main()
{
    Circle a(2);
    Rectangle b(5,3.5);
    Triangle c(2,3,4);
    a.printArea();
    b.printArea();
    c.printArea();
    return 0;
}
出现2.cpp(42) : error C2064: term does not evaluate to a function如何解决
搜索更多相关主题的帖子: function include public double return 
2016-04-20 13:35
稻草人25
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2016-4-20
收藏
得分:0 
回复 2楼 rjsp
谢谢  才发现
2016-04-20 14:32
稻草人25
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2016-4-20
收藏
得分:0 
回复 楼主 稻草人25
谢谢  程序上还有没有其他问题??
2016-04-21 12:05
快速回复:error C2064: term does not evaluate to a function
数据加载中...
 
   



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

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