单选题 C++
题号 #4238259

如下函数模板:
template<class T>T square(T x){return x*x;}
其中T是(   )。

进入在线模考

参考答案

C

答案解析

本题考查模板函数的基本概念,根据模板函数的定义,T是模板形参,所以答案为C。

你可能感兴趣的试题

A.template<typenameT>T abs(T x){return x<0?-x:x;}
B.template class<T>T abs(T x){return x<0?-x:x;}
C.template T<class T>abs(T x){return x<0?-x:x;}
D.template T abs(T x){return x<O?-X:x;}
A.类
B.对象
C.模板
D.函数
找试题 · 找答案 · 找资料 在线模考