单项选择题

有如下类定义:
class Foo
public:
Foo(int v) : value(v) // ①
~Foo() // ②
private:
Foo() // ③
int value = 0; // ④
;
其中存在语法错误的行是( )。

A.①
B.②
C.⑧
D.④
<上一题 目录 下一题>
热门 试题

单项选择题
下列程序运行后的输出结果是( )。 #include<iostream.h> void fun(int,int,int*); void main() int x,y,z; fun(5,6,&x); fun(7,x,&y); fun(x,y,&z); cout<<x<< , <<y<< , <<z<<endl; void fun(int a,int b,int *c) b+=a; *c=b-a;
A.5,5,5
B.6,6,6
C.5,6,7
D.7,7,7
单项选择题
有如下程序: #include <iostream> using namespace std; class Base public: void fun() cout<< Base::fun <<endl; ; class Derived : public Base public: void fun() ______ cout<< Derived::fun <<endl; ; int main() Derived d; d.fun(); return 0; 已知其执行后的输出结果为: Base::fun Derived::fun 则程序中下划线处应填入的语句是( )。
A.Base.fun();
B.Base::fun();
C.Base->fun();
D.fun();
相关试题
  • 下列程序的运行结果为( )。 #include...
  • 下列程序的输出结果是( )。 #include...
  • 下列程序的运行结果为( )。 #include...
  • 下列程序的输出结果是( )。 #ificlude...
  • 只能作为成员函数重载的是( )。