选择题 下列C++标点符号中表示一条语句结束的是______。
选择题 C++语言做了很多改进,下列描述中_______使得C语言发生了质变,即从面向过程变成面向对象。
选择题 下列字符串中,正确的C抖标识符是 。
选择题 以下定义数组中错误的是______
选择题 若有下列定义
int x[10],*pt=x;
则对x数组元素的正确引用是______。
选择题 语句ofstream f('SALARY. DAT', ios: :app | ios: :binary) ;的功能是建立流对象f,试图打开文件SALARY.DAT并与之连接,并且
选择题 下列选项中,正确的C++标识符是______。
选择题 要利用C++流实现输入输出的各种格式控制,必须在程序中包含的头文件是______。
选择题 有如下数组声明:int num[10];,下标值引用错误的是______。
选择题 类MyClass的定义如下:
class MyClass
{
public:
MyClass(){value=0;}
SetVariable(int i){value=i;}
private:
int value;
};
则对下列语句序列正确的描述是 。
MyClass*P,my;p=my;
选择题 下列选项中,不是一个算法的基本特征的是______。
选择题 有如下定义:
int a[5]={1,3,5,7,9}, *p=a;
下列表达式中不能得到数值5的是______
选择题 有以下程序:
#include<iostream>
using namespace std;
class sample
{
private:
int n;
public:
sample(){}
sample(int m)
{
n-m;
}
sample add(sample s1,sample s2)
{
this->n=s1.n+s2.n;
return(*this):
}
void disp()
{
cout<<'n='<<n<<endl;
}
};
int main()
{
sample s1(10),s2(5),s3;
s3.add(s1,s2);
s3.disp();
return 0;
}
程序运行后,输出的结果是______。
选择题 下面对静态数据成员的描述中,正确的是______。
选择题 以下程序执行后的输出结果是 。
#include <iostream>
using namespace std;
void try(int,int,int,int);
int main()
{
int x,y,z,r;
x=1;
y=2;
try(x,y,z,r);
cout<<r<<endl;
return 0;
}
void try(int x,int y,int z,int r)
{
z=x+y;
x=x*x;
y=y*y;
r=z+x+y;
}
选择题 有下列程序:
#include <stdio.h>
#include <stdlib.h>
int fun(int n)
{ int * p;
p=(int*)malloc(sizeof(int));
*p=n; return*p;
}
void main()
{ int a;
a=fun(10); printf('d\n',a+fun(10));
}
程序的运行结果是______。
选择题 下列关于C++关键字的说法中正确的是______。
选择题 在下列字符中,不允许作为C++标识符的是______。
选择题 下列程序段中的变量已正确定义:
for(i=0;i<1;i++,i++)
for(k=1;k<3;k++);printf('*');
程序段的输出结果是______。
选择题 有如下类定义:
class MyClass{
public:
______
private:
int data;
};
若耍为Myclass类重载流输入运算符>>,使得程序中可以“cin>>obj;”形式输入MyClass类的对象obj,则横线处的声明语句应为______。
