单选题

#include&nbsp&ltiostream&gt class&...

发布于 2022-03-02 16:09:14

#include <iostream>
class Parent {
    public:
        Parent() { std::cout << "1" }
        Parent(const Parent &p) { std::cout << "2" }
            const Parent &operator=(const Parent &p) {
            std::cout << "3"
        return *this
    }
}
int main() {
    Parent p
    Parent p1(p)
    Parent p2 = p
    p2 = p1
}
以上代码的输出为:

登录后免费查看答案
关注者
0
被浏览
15
知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看