单选题有如下程序 #include void main( )
{ char ch[2][5]={" 6937"," 8254"},* p[2]; int
i,j,s=0; for(i=0;i,/'0',;j+=2) s=10 *
s+p[i][j]-'0'; cout < < S;}
该程序的输出结果是
单选题有如下类定义: class MyClass { public: _____________ private: int data; };若要为 MyClass 类重载流输出运算符 <<,使得程序中可以"cout << obj;"这样的语句输出 MyClass 类的对象 obj 中成员变量 data 的值,则横线处应填入的语句是
单选题下列情况中,不会调用拷贝构造函数的是______。
单选题执行下面程序中的输出语句后,a的值是
main( )
{
int a;
cout<<(a=3*5,a*4,a+5);
}
单选题下面程序的输出结果是 #include<iostream.h> #include<string.h> void main( ) { char p1[10],p2[10] strcpy(p1,"abc"); strcpy(p2,"ABC"); char str[50]="xyz"; strcpy(str+2,strcat(p1,p2)); cout<<str; }
单选题下列选项中,与实现运行时多态性无关的是______。
单选题有如下程序: #include <iostream> using namespace std; class AA int n; public: AA(int k):n(k) int get()return n; int get()constreturn n+1; int main() AA a(5); const AA b(6); cout<<
单选题有如下定义: int a[5]={1,3,5,7,9},*p=a;
下列表达式中不能得到数值5的是______。
A.a[2]
B.a[3]
C.*(p+2)
D.*p+4
单选题有下列程序: #include<iostream> using namespace Std; class Test { public: Test() {n+=2;} ~Test() {n-=3;} static int getNum(){return n;} private: static int n; }; int Test∷n=1; int main() { Test*p=new Test; delete p; cout<<"n="<<Test∷getNum()<<endl; return 0; } 执行该程序的输出结果是( )。
单选题建立派生类对象时,3种构造函数分别是a(基类的构造函数)、b(成员对象的构造函数)、c(派生类的构造函数)这3种构造函数的调用顺序为( )。
单选题若有如下程序: #include <iostream> using namespaces std; int s=0; class sample { static iht n; public: sample(int i) { n=i; } static void add() { s+=n; } }; int sample::s=0; int main() { sample a(2),b(5); sample::add(); cout<<s<<endl; return 0; } 程序运行后的输出结果是
单选题在下列选项中,不允许作为C++标识符的是
单选题关于类模板,下列表述中不正确的是______。
单选题下面描述正确的是______。
单选题派生类的成员函数不能访问基类的{{U}} {{/U}}。
A.公有成员和保护成员
B.公有成员
C.私有成员
D.保护成员
单选题为类Matrix重载下列运算符时,只能作为Matrix类成员函数重载的运算符是______。
单选题有如下类定义: class XX int xdata: public: xx(int n=0):xdata(n) class YY:public XX int ydata; public: YY(int m=0,int n=0):xx(m),ydata(n) ; YY类的对象包含的数据成员的个数是
单选题下列关于C++流的描述中,错误的是______。
单选题有如下程序:
#include <iostream.h>
#include <iomanip.h>
using namespace 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;
}
执行上面程序的输出是
单选题以下不使用线性结构表示实体之间联系的模型的是( )。