单选题有如下程序:
#nclude
using namespace std;
int main()
{
void function(double val);
double val;
function(val);
cout<
单选题决定c++语言中函数的返回值类型的是( )。
单选题若要重载+、=、<<、==和[]运算符,则必须作为类成员重载的运算符是( )。
单选题对如右二叉树进行后序遍历的结果为()。
单选题带有虚基类的多层派生类构造函数的初始化列表中都要列出虚基类的构造函数,这样将对虚基类的子对象初始化______。
单选题下列说法有错误的是 ______。 A) 公有继承时基类的public成员在派生类中仍是public B) 私有继承时基类的public成员在派生类中为private C) 保护继承时基类的protected成员在派生类中是protected D) 保护继承时基类的private成员在派生类中是protected
单选题两个关系有若干相同属性名等值连接,并去掉重复属性的关系代数运算称为 ______。
单选题下列程序的输出结果为
____
。
#include<iostream.h>
#include<iomanip.h>
voidmain()
{
cout.precision(4);
cout<<123.127;
cout<<””<<123.46:
}
单选题根据数据结构中各数据元素之间前后关系的复杂程度,一般将数据结构分成( )。
单选题有如下程序:#include <iostream>#include <iomanip>using nanespace std;class CSum{ int x,y; public: CSum (int x0,int y0):x(x0),y(y0){} friend ostream return os; }};int main(){ CSum y(3,5); cout<<setfill('*')<<8; cout<<y; return 0;}执行上面程序的输出是( )。
单选题下列程序的执行结果是( )。 #include<iostream.h> class Sample int x,y; public: Sample() x=y=0; Sample(int a,int b) x=a;y=b; ~Sample() if(x==y) cout<<"x=y"<<end1; else cout<<"x!=y"<<end1; void disp() cout<<"x="<<x<<",y="<<y<<end1; ; void main() Sample s1(2,3); s1.disp();
单选题关系模型允许定义3类数据约束,下列不属于数据约束的是( )。
单选题设n=10,i=4,则赋值运算n%=i+1执行后,n的值是
____
。
单选题有如下语句序列:
char str[10];cin>>str;
当从键盘输入“I love this game”时,str中的字符串是______。
单选题分析下面程序,该程序的运行结果是( )。 #include<iostream.h> class TestClass{ public: static int m; TestClass () { m++; } TestClass(int n) { re=n; } static void test() { m++; } }; int TestClass::m=0; void main() { TestClass A; TestClass B(3); A.test(); TestClass::test(); cout<<''m''=''<<B.m<<endl; }
单选题开发大型软件时,产生困难的根本原因是( )。 A) 大型系统的复杂性 B) 人员知识不足 C) 客观世界千变万化 D) 时间紧、任务重
单选题在声明派生类时,如果不显示地给出继承方式,缺省的类继承方式是私有继承private。己知有如下类定义: class TestClass{ protected: void fun(){} }; class TestClass 1:TestClass{};则TestClass类中的成员函数fun(),TestClass1类中的访问权限是( )。
单选题下列程序的输出结果是
#inClUde<iostream>
using namespace std;
intmain()
{
Char a[]="HellO,World";
Char*ptr=a;
while(*ptr)
{
if(*ptr>='a'&& *ptr <='Z')
cout<<char(*ptr+'A' -'a');
else cout<<*ptr;
ptr++;
}
retur0;
}
A) HELLO,WORLD
C) Hello,world
C) hELLO,wORLD
D) hellO,world
单选题有如下程序:
#include<iostream>
using namespace std;
void fun(char c) {cout<<"char c/";}
void fun(double d) {cout<<"double d/";}
void fun(char*p) {cout<<"char*p/";}
int main(){
fun(0);
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;}