单选题有如下程序:#include<iostream>using namespace std;class Base{public:Base(){Fuction();}virtual void Fuction(){cout<<"Base::Fuction"<<endl:}};class Derived:public Base{public:Derived(){Fuction();}virtual void Fuction(){cout<<"Derived::Fuction"<<endl:}};int main(){Derived a;return0;}运行后的输出结果是( )。
单选题下列有关运算符重载的叙述中,正确的是______。
单选题下列定义语句中,错误的是( )。
单选题下列函数模版中的定义中,合法的是( )。
单选题数据库关系模型中可以有三类完整性约束,下列选项中不属于三类完整性约束的是
____
。
单选题若有定义语句“double x,y,*px,*py;执行了px=&x;py=&y;”后,正确的输入语句是( )。
单选题假设AB为一个类,则该类的拷贝构造函数的声明语句为______ 。
单选题下面程序的输出结果是
main( )
{int a=15,b=21,m=0;
switch(a%3)
{ case 0:m++;break;
case 1:m++;
switch(b%2)
{default:m++;
case 0:m++;break;
}
}
cout<<m<<endl;
}
单选题两次运行下面的程序,如果从键盘上分别输入10和8,则输出结果为 ______。 #include<iostream.h> viod main() int x: cin>>x: if(x++>9)cout<<x; else cout<<x—<<endl;
单选题下面不属于C++的预定义的流对象是( )。
单选题有以下类定义 class Point public: Pointint x = 0, int y=0) _x = x; _y = y; void Move int xoff, int yoff) _x +=xoff;_y+=yoff; void Print() const cout<<'('<<_x<<','<<_y<<')' << end1; private: int_x,_y; ; 下列语句中会发生编译错误的是 A) Point pt;pt.Print(); B) const Point pt;pt.Print(); C) Point pt;pt.Move(1, 2); D) const Point pt;pt.Move(1, 2)
单选题下列程序的运行结果是{{U}} {{/U}}。#include<iostream.h>void
fun(int *a, int *b) {int *k; k=a; a=b; b=k;}void main(){int
a=2OO4,b=9,*x=fun(x, y);cout<<a<<" "<<b<<end1;}
A.20049
B.92004
C.00
D.编译时出错
单选题若希望派生类的对象不能访问基类中公有成员,应在( )方式下完成。
单选题下列选项中,与实现运行时多态性无关的是( )。
单选题面向对象程序设计将数据与
____
放在一起,作为一个互相依存、不可分割的整体来处理。
单选题在模块化程序设计中,按功能划分模块的原则是
单选题下列选项中,与实现运行时多态性无关的是( )。
单选题有以下程序:
#define P 3
void F(int x){return(P*x*x);}
main()
{printf("%d\n",F(3+5));}
程序运行后的输出结果是______。
单选题在下面程序中,A、B、C、D四句编译时不会出错的是
____
。
#include <iostream>
using namespace std;
class Base{
public:
Base();
Base(int e):count(C) {}
virtual void print() const = 0;
private:
int count;
};
class Derived :public Base{
public:
Derived():Base(0) {}
Derived(int C) :Base(C) {}
void printt() const{cout<< "Derived"<<endl:}
};
void main( ) {
Derived d(10);
Base *pb;
pb = //A
Base
Derived dd = *pb; //B
Derived //C
Base bb = d; //D
单选题形如A::A(A &)的构造函数称为( )。
