填空题
已知int DBL(int n)return n+n;和long DBL(long n)return n+n是一个函数模板的两个实例,则该函数模板的定义是______。
【参考答案】
template<class T> T DBL(T n){return n+n;}
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
有以下程序 #include <iostream> using namespace std; class Base int a; public: Base(int x) a=x; void show() cout<<a; class Derived : public Base int b; public: Derived(int i) :Base(i+1),b(i) void show() cout<<b; ; int main () Base b(5),*pb; Derived d(1); pb=&d; pb->show (); return 0; 运行后的打印结果是______。
点击查看答案&解析
填空题
执行语句序列 int x=10,&r=x; cout<<x<<’-’<<r<<endl; 输出结果为______。
点击查看答案&解析
相关试题
有以下程序: #include <iostream> u...