编写一个重载> =和%=运算符的程序[关闭]

问题描述 投票:-8回答:1

编写一个重载> =和%=运算符的程序。用C ++语言编写完整程序。这个问题与函数重载有关。

c++
1个回答
1
投票
class Boss
{
    // write your full class in C++ language
public:
    bool operator>=(const Boss& other) const;
    Boss& operator%=(const Boss& other);
};
bool Boss::operator>=(const Boss& other) const
{
    // write your full logic in C++ language
    return result;
}

Boss& Boss::operator%=(const Boss& other)
{
    // write your full logic in C++ language
    return *this;
}
© www.soinside.com 2019 - 2024. All rights reserved.