[单选题]

类模板templateclassX{…},其中友元函数f对特定类型T(如int),使函数f(x)成为x模板类的友元,则其说明为( )。

A.friendvoidf();

B.friendvoidf(x);

C.friendvoidA::f();

D.friendvoidC::f(x);

参考答案与解析:

相关试题

类模板templateclass x{…},其中友元函数f对特定类型T(如int

[单选题]类模板templateclass x{…},其中友元函数f对特定类型T(如int),使函数f(x)成为x

  • 查看答案
  • 类模板templateclass x{...},其中友元函数f对特定类型T(如i

    [单选题]类模板templateclass x{...},其中友元函数f对特定类型T(如int),使函数f(x)成为x

  • 查看答案
  • 类模板templateclass x{…},其中,友元函数f对特定类型T(如in

    [单选题]类模板templateclass x{…},其中,友元函数f对特定类型T(如int),使函数f(x&=成类模板template<class T>class x{…},其中,友元函数f对特定类型T(如int),使函数f(x<int>&=成为x<int>模板类的友元,则其说明为( )。A.friend void f();B.friend void f(x<T>&=;)C.friend void A::f()D.friend void C<T>::f(x<T>&=;)

  • 查看答案
  • 类模板templateclass x{...},其中,友元函数f对特定类型T(如

    [单选题]类模板templateclass x{...},其中,友元函数f对特定类型T(如int),使函数 f(x);成为类模板template<class T>class x{...},其中,友元函数f对特定类型T(如int),使函数 f(x<int>);成为x<int>模板类的友元,则其说明为( )。A.friend void f();B.friend void f(x<T>);C.friend void A:: f()D.friend void C<D:: f(x<T>);

  • 查看答案
  • 类模板templateclass x(…),其中,友元函数f成为从该类模板实例化

    [单选题]类模板templateclass x(…),其中,友元函数f成为从该类模板实例化的每个模板类的友元,则类模板template<class T>class x(…),其中,友元函数f成为从该类模板实例化的每个模板类的友元,则其说明应为( )。A.friend void f();B.friend void f(x<T>&)C.friend void A::f();D.friend void C<T>::f(x<T>&):

  • 查看答案
  • 设int f (int);和int g(int);是函数f和g的原形,以下将f作

    [单选题]设int f (int);和int g(int);是函数f和g的原形,以下将f作为语句调用的是______ 。A.g(f(3))B.f(g(3));C.g(f(3)+2);D.p=f(g (3)+1);

  • 查看答案
  • ( 8 )已知有函数 f 的定义如下:int f(){static int s=

    [试题]( 8 )已知有函数 f 的定义如下:int f(){static int s=0;s+=2;return s;}则在某程序中第 2 次执行函数调用语句 f( ) ; 时 , 函数 f 的返回值是 ___________ 。

  • 查看答案
  • 类模板不同于函数模板类模板只可用(14)型函数。

    [主观题]类模板不同于函数模板类模板只可用(14)型函数。

  • 查看答案
  • 设有以下函数: f(int a){int b=0;static int c=3;

    [单选题]设有以下函数: f(int a) { int b=0; static int c=3; b++; c++; return(a+b+c); } 如果在下面的程序中调用该函数,则输出结果是______。 main() { int a=2, i; for(i=0; i<3; i++)printf("% d/n", f(a)); }A.7 8 9B.7 9 11C.7 10 13D.7 7 7

  • 查看答案
  • ( 8 )已知递归函数 f 的定义如下:int f(int n){if (n <

    [试题]( 8 )已知递归函数 f 的定义如下:int f(int n){if (n <= 1) return 1; // 递归结束情况else return n * f(n-2); // 递归 }则函数调用语句 f(5) 的返回值是 ( 8 ) 。

  • 查看答案
  • 类模板templateclassX{…},其中友元函数f对特定类型T(如int)