鱼C论坛

 找回密码
 立即注册
查看: 3863|回复: 0

求解“no matching function for call to”的问题

[复制链接]
发表于 2013-5-6 17:08:19 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
#include <iostream>
#include <stdlib.h>

using namespace std;

enum Color {Red, Yellow, Green, White};

class Circle
{
    float radius;
public:
    void Cricle(float r)
    {
        radius = r;
    }
    float Area()
    {
        return 3.14*radius*radius;
    }
};

class Table
{
    float height;
public:
    Table(float h)
    {
        height = h;
    }
    float Height()
    {
        return height;
    }
};

class RoundTable:public Table,public Circle
{
    Color color;
public:
    RoundTable(float h, float r, Color c);
    int GetColor()
    {
        return color;
    }
};

RoundTable::RoundTable( float h, float r, Color c):Table(h),Circle(r)           
{                                                                                     : no matching function for call to`Circle::Circle(float&)'
    color = c;
}

int main()
{
    RoundTable cir_table(15.0, 2.0, Yellow);

    std::cout << "The table properties:" << endl;

    std::cout << "Height = " << cir_table.Height() << endl;

    std:: cout << "Area = " << cir_table.Area() << endl;

    std::cout << "Color = " << cir_table.GetColor() << endl;
}


小甲鱼最新课程 -> https://ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-7-29 03:06

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表