单项选择题
有如下函数模板: template<typename T,typenaine U> T cast(U u){return u;} 其功能是将U类型数据转换为T类型数据。已知i为int型变量,下列对模板函数cast的调用中正确的是
A.cast(i);
B.cast<>(i);
C.cast<char*,int>(i);
D.cast<double,int>(i);
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下类定义: class AA{ int a; public: int getRef( )eonst{return &a;} ① int getValue( )const{return a;} ② vold set(int n)eonst{a=n;} ③ friend void show(AA aA) eonst{tout<<a;} ④ }; 其中的4个函数定义中正确的是
A.①
B.②
C.③
D.④
点击查看答案&解析
单项选择题
有如下程序: int x=3: d0{ x-=2: cout<<x: }while(!(--x)); 执行这个程序的输出结果是
A.1
B.30
C.12
D.死循环
点击查看答案&解析
相关试题
有如下类定义: class Test { public...
有如下程序: #include <iostream> u...
有如下程序: #include <lostream> u...
有如下程序: #include <iostream> u...
有如下类定义: class MyBase{ int k...