全部题库 / C++ / 试题详情
单选题 C++
2017-03-30

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

A.函数形参
B.函数实参
C.模板形参
D.模板实参

参考答案

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.函数