pb=b
pb=&b[0]
pb=newint
pb=b[5]
第1题:
若x是整型变量,pb是基类型为整型的指针变量,则不正确的赋值表达式是()。
A、*pb=&x;
B、pb=&x
C、pb=x;
D、*pb=*x
第2题:
设有C语言变量说明“static int a[][2]={{1,2),(3,4}};int *pa,(*pb)[2];”,则执行语句“pa=pb=&a[0][0];”后,(*(pa+1))的值为(31)。
A.2
B.3
C.&a[0][1]
D.&a[1][0]
第3题:
为使程序的输出结果为: Base:: fun 那么应在下列程序画线处填入的正确语句是( )。 #include <iostream> using namespace std; class Base { public: void fun () { cout<<"Base: :fun"<<end1; } }; class Derived : public Base { public: void fun ( ) { cout<<"Derived: :fun"<<end1; } }; int main ( ) { Base a,*pb; Derived b; _________; pb->fun(); //调用基类的成员函数 fun() return 0 ; }
A.pb=&a
B.pb=b
C.pb=&b
D.pb=&Base
第4题:
第5题:
第6题:
有以下变量说明,下面正确的语句是() int a=10,b; int &pa=a,&pb=b;
第7题:
假定有定义“intb[10];int*pb;”,则不正确的赋值语句为()。
第8题:
假定有定义“intb[10];int*pb;”,则不正确的赋值语句为()。
第9题:
假定有定义“intb[10];int*pb;”,则不正确的赋值语句为()。
第10题:
pb=b;
pb=&b[0];
pb=newint;
pb=b[5];
第11题:
&pb=a;
pb=pa;
pb=&pa;
?pb=?pa;
第12题:
*(pb+l)=24
*(b+l)=24
*++b=24
*++pb=24
第13题:
若x是整型变量,pb是基本类型为整型的指针变量,则正确的赋值语句是 ( )
A.pb=&x;
B.pb=x;
C.* pb=& x;
D.* pb=* x;
第14题:
如下程序执行后的输出结果是【 】。
include <iostream>
using namespace std;
class Base
{
public:
Base(int x,int y)
{
a=x;
b=y;
}
void Show()
{
cout<<"Base: "<<a<< ',' <<b<<" ";
}
private:
int a,b;
};
class Derived : public Base
{
public:
Derived(int x, int y, int z) : Base(x,y),c(z) { }
void Show()
{
cout<<"Derived:"<<c<<end1;
}
private:
int c;
};
int main()
{
Base b(100,100),*pb;
Derived d(10,20,30);
pb=&b;
pb->Show();
pb=&d;
pb->Show();
return 0;
}
第15题:
x是整型变量,pb是整型指针变量,如果将pb指向x,则正确的表达式是 (56)。
A.Pb=&x
B.pb=X
C.*pb=&x
D.*pb=*x
第16题:
第17题:
假定有语句为“int b[10]; int *pb;”,则下面不正确的赋值语句为()。
Apb=b;
Bpb=&b[0];
Cpb=b+2;
Dpb=b[5];
第18题:
假定有定义“intb[10];int*pb;”,则不正确的赋值语句为()。
第19题:
要使语句“p=newint[10][20];”正确,p应事先定义为()。
第20题:
假定变量b和pb定义为“intb[10],*pb=b;”,要将24赋值给b[l]元素中,不正确的赋值语句是()。
第21题:
pb=b
pb=&b[0]
pb=newint
pb=b[5]
第22题:
pb=b;
pb=&b[0];
pb=b+2;
pb=b[5];
第23题:
pb=b;
pb=&b[0];
pb=new int;
pb=b[5];
第24题:
P(AB.=PA.PB.
B.P(A+B.=P+PB.-P(AB.
C.P+PB.=1
D.P(A/B.=P[PB.≠0]