填空题
下面程序的输出结果是
【13】
。
#include <iostream>
using namespace std;
class A
int a, b;
public:
A()
a = b = 0;
A(int aa, int bb ) : a(aA) , b(bB)
cout <<"a="<<a<<","<<"b="<<b<<",";
~A()
cout<<"D";
;
int main ( )
A x, y(2, 3);
return 0;
【参考答案】
a=B,b=CDD
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
下面程序是一个堆栈的类模板,在横线处填上适当语句,完成类模板的定义。 #define MAXSIZE 100 template <class T> class Stack T s[MAXSIZE]; int top; public: stack() top=1; void push(T newValue) if(top<MAXSIZE) top=top+1; s[top]=newValue; else cout<< 堆栈满,无法进栈 <<end1; void pop(); ; 【12】 if(top>1) cout<<s[top]<<end1; top=top-1; else cout<< 堆栈空! <<end1;
点击查看答案&解析
填空题
实现编译时的多态性的机制称为 【10】 ,实现运行时的多态性的机制称为 【11】 。
点击查看答案&解析
相关试题
有以下程序: #include <fstream> #...
若有以下程序: #include <iostream>...