单选题有以下程序:
#include <iostream>
using namespace std;
class B
{
private:
int a,b;
public:
B(){}
B(int i,int j);
void printb();
};
class A
{
B C;
public:
A(){}
A(int i,int j);
void printa();
};
A::A(int i,int j) :c(i,j) {}
void A::printa()
{
c.printb ();
}
B::B(int i, int j)
{
a=i;
b=j;
}
void B: :printb()
{
cout<<a<<", "<<b<<end1;
}
int main ()
{
A m(7,8);
m.printa();
return 0;
}
该程序运行后的输出结果是
____
。
单选题有如下类定义: class Point { int xx,yy; public: Point():xx(0),yy(0){} Point(int x,int y=0):xx(x),yy(y){} }; 若执行语句 Point a(2),b[3],*[4]; 则Point类的构造函数被调用的次数是( )。
单选题类的成员函数中,只能用于检测输入操作的函数是 ______。
单选题运算符重载时不需要保持的性质是( )。
单选题有如下程序:
#include<iostream>
using namespace std;
class TlestClass
{
int n;
public:
TestClass(int k):n(k){}
int get(){return n;}
int get()const{return n+1;}
};
int main()
{
TestClass p(5);
const TestClass q(6);
cout<<p.get()<<q.get();
return 0;
}
执行后的输出结果是______。
单选题有如下类定义: class Foo { public: Foo(int v):value(v){} //① -Foo(){} //② private: F00(){} //③ int value=0; //④ }; 其中存在语法错误的行是( )。
单选题某二叉树共有399个结点,其中有199个度为2的结点,则该二叉树中的叶子结点数为( )。
单选题下列程序段中有错的是( )。 A.template <Class Type> B.Type C.func(Typea,b) D.return(a>b)?(a):(b);
单选题有下列程序:
#include <stdio. h>
void fun(int a[],int n)
{ int i,t;
for(i=0;i<n/2;i++) {t=a[i];a[i]=a[n-1-i]; a[n-1-i]=t;}
}
void main()
{ int k[10]={1,2,3.4,5,6,7,8,(),10),i;
fun(k,5);
for(i=2,i<8;i++)printf("%d",k[i]);
printf("/n");
}
程序的运行结果是______。
单选题运算符重载时不需要保持的性质是( )。
单选题下列关于运算符重载的叙述中,错误的是( )。
单选题下列关于C++函数的说明中,正确的是( )。
单选题软件生命周期是指( )。
单选题下列关于C++函数的叙述中,正确的是
A.每个函数至少要具有一个参数
B.每个函数都必须返回一个值
C.函数在被调用之前必须先声明
D.函数不能自己调用自己
单选题对下列二叉树进行中序遍历的结果是
单选题在C++语言中,数据封装要解决的问题是
单选题下列有关类继承的叙述中,错误的是( )。
单选题若有说明语句 char a[]="It is mine";
char*p=" It is mine"; 则以下不正确的叙述是{{U}} {{/U}}。
A.a+1表示的是字符t的地址
B.p指向另外的字符串时,字符串的长度不受限制
C.P变量中存放的地址值可以改变
D.a中只能存放10个字符
单选题下列各项中不属于算法基本特征的是( )。
单选题在C++中,编译系统自动为一个类生成默认构造函数的条件是