下列代码输出为()
发布于 2022-03-03 14:26:50
下列代码输出为() class Test {
int a
public:
Test() : a(0) {cout << "void"}
explicit Test(int i) : a(i) {cout << "int"}
Test(short s) : a(s) {cout << "short"}
Test &operator=(int n) {a = n cout << "operator="}
}
int main() {
int n
Test a = n
}
登录后免费查看答案
关注者
0
被浏览
32
发布于 2022-03-03 14:26:50
下列代码输出为()
class Test { int a public: Test() : a(0) {cout << "void"} explicit Test(int i) : a(i) {cout << "int"} Test(short s) : a(s) {cout << "short"} Test &operator=(int n) {a = n cout << "operator="} } int main() { int n Test a = n }
登录后免费查看答案
关注者
0
被浏览
32