单项选择题

有以下程序: #include <iostream> #include <string> using namespace std; int main ( ) { char b1[8] = "abcdefg"; char b2[8],*pb=b1+3; while (--pb>=b1) strcpy (b2, Pb) ; cout<<strlen (b2) <<end1; return 0; } 程序运行后的输出结果是( )。

A.8
B.3
C.1
D.7
<上一题 目录 下一题>
热门 试题

单项选择题
若有以下程序: #include <iostream> using namespace std; class point { private: int x, y; public: point ( ) { x=0; y=0; } void setpoint(int x1,int y1) { x=x1; y=y1; } void dispoint () { cout<< x= <<x<< , << y= <<y<<end1; } }; int main ( ) { point *p=new point; p->setpoint (5, 12); p->dispoint (); return 0; } 程序运行后的输出结果是( )。
A.x=12,y=12
B.x=5,y=5
C.x=12,y=5
D.x=5,y=12
单项选择题
应在下列程序画线处填入的正确语句是 ( )。 #include <iostream> using namespace std; clas Base { public: void fun() { cout<< Base::fun <<end1; } }; class Derived : public Base { void fun() { ________________ 显示调用基类的函数 fun() cout<< Derived::fun <<end1; } };
A.fun();
B.Basfun();
C.Base::fun();
D.Base->fun();
相关试题
  • 对于switch(C) 中的变量c不能定义为的类...
  • 在面向对象方法中,一个对象请求另一对象为...
  • 以下不能正确创建输出文件对象并使其与磁盘...
  • 有以下程序: #include<iostream> usi...
  • 堆栈s进行下列操作:push(1);push(2...