阅读c++代码输出() class base1{ ...
发布于 2022-03-02 16:51:17
阅读下面 C++ 代码,输出结果为()
#include <iostream> using namespace std class base1 { private: int a, b public: base1(int i) : b(i + 1), a(b) {} base1():b(0), a(b) {} int get_a() { return a } int get_b() { return b } } int main() { base1 obj1(11) cout << obj1.get_a() << endl << obj1.get_b() << endl return 0 }
登录后免费查看答案
关注者
0
被浏览
33