下列函数模板的定义中,合法的是( )。

admin2019-05-06  35

问题 下列函数模板的定义中,合法的是(    )。

选项 A、templateT abs(T x){return x<0?一x:x;}
B、template classT abs(T x){return x<0?一x:x;}
C、template Tabs(T x){return x<0?一x:x;}
D、template T abs(T x){return x<07一x:x;}

答案A

解析 本题考查模板函数的基本概念,根据模板函数的定义,所以答案为A。
转载请注明原文地址:https://kaotiyun.com/show/Xs8p777K
0

随机试题
最新回复(0)