选择题 关于函数中的<返回类型>,下列表述中错误的是 。
选择题 软件按功能可以分为应用软件、系统软件和支撑软件(或工具软件),下面属于系统软件的是______。
选择题 以下程序的输出结果是 。
#include<iostream.h>
main()
{
int m=5;
if(m++>5)
cout<<m;
else cout<<m--;
}
选择题 软件按功能可以分为应用软件、系统软件和支撑软件(或工具软件)。下面属于应用软件的是______。
选择题 下面的叙述中,不符合赋值兼容规则的是______。
选择题 有如下程序:
#include<iostream>
using namespace std;
class clock
{
public:
clock():seconds(0){};
clock()perator++()
{
this->seconds++;
return *this;
}
void display()
{
cout<<this->seconds<<'';
}
private:
int seconds;
};
int main()
{
clock c;
++c;
c.display();
(++(++c)).display();
c.display();
return 0;
}
运行后的输出结果是______。
选择题 下面程序的输出结果为 。
#include<iostream.h>
class TestClass
{
public:
TestClass (){val++;}
static int val;
};
int TestClass::val=0;
void main()
{
TestClass cs1;
cout<<cs1.val<<'';
TestClass cs2;
TestClass cs3,cs4;
cout<<cs2.val<<endl;
}
选择题 有如下程序:
#include < iostream >
using namespaee std;
class Base1
{
public:
Base1(int d) { cout <<d; }
~Base1 () {}
};
class Base2
{
public:
Base2 ( int d) { cout << d;}
~Base2() {}
};
class Derived: public Base1, Base2
{
public:
Derived(int a, int b, int c, int d) :Base1(b), Base2(a), b1(d), b2(e) {}
private:
int b1;
int b2;
};
int main()
{
Derived d(1,2,3,4);
return 0;
}
执行这个程序的输出记过是 。
选择题 下列程序的运行结果为
#include<iostream.h>
template<class TT>
class FF
{ TTa1,a2,a3;
public:
FF(TT b1,TT b2,TT b3) {a1=b1;a2=b2;a3=b3;}
TT Sum( ) {return a1+a2+a3;}};
void main( )
{ FF <int> x(int(1.1) ,2,3) ,y(int(4.2) ,5,6) ;
cout < < x. Sum( ) < <' ' < < y. Sum( ) < < endl;}
选择题 下面的叙述中错误的是______。
选择题 针对数组定义int data[10];,下列表述中错误的是______
选择题 有如下类定义:
class Sample{
public;
Sample(int x):ref(x){} //①
private:
Sample():ref(0){} //②
static int val=5; //③
constint ref; //④
};
上述程序段中,错误的语句是______。
选择题 下列字符串中不能作为C++标识符使用的是______。
选择题 下列叙述中正确的是______。
选择题 下列C++标点符号中表示一条预处理命令开始的是 。
选择题 下列关于this指针的叙述中,正确的是 。
选择题 有如下函数模板定义:
template<class T>
T func(T x,T y){return x*x+y*y;}
在下列对func的调用中不正确的是______。
选择题 有如下程序:
#include<iostream>
using namespace std;
class Publication{ //出版物类
char name[30];
public:
Publication(char *name='未知名称'){
strcpy(this->name,name);
}
const cha * getName()const{return name;}
virtual const char * getType()const{return'未知类型';}
};
class Book:public Publication{ //书类
public:
Book(char *name): Publication(name){}
virtual const char * getType()const{return'书';}
};
void showPublication(Publication p){
cout<<p.gettype()<<':'<<p.getName()<<endl;
}
int main(){
Book book('精彩人生');
showPublication(book);
return 0;
}
运行时的输出结果是______。
选择题 下列有关继承和派生的叙述中,正确的是______。
选择题 下列关于函数参数的叙述中,正确的是______。
