网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
若有语句 int *point, a = 4; point = &a; 下面均代表地址的一组选项是()
A.point,*&a
B.&*a,&a, *point
C.*&point, *point, &a
D.&a, & *point,point
参考答案和解析
&a, &*point , point
更多 “若有语句 int *point, a = 4; point = a; 下面均代表地址的一组选项是()A.point,*aB.*a,a, *pointC.*point, *point, aD.a, *point,point” 相关考题
考题
下列语句中,错误的是______。A.const int buffer=256;B.const double*point;C.int const buffer=256;D.double*const point;
考题
有如下类定义:class Point{int x_, y_;public:Point():x_(0), y_(0){}Point(int x, int y = 0):x_(x),y_(y){}};若执行语句Point a(2), b[3] , *c[4];则 Point 类的构造函数被调用的次数是A . 2 次B . 3 次C . 4 次D . 5 次
考题
( 18 ) 下列语句中,错误的是A ) const int buffer=256;B ) const double *point;C ) int const buffer=256;D ) double * const point;
考题
( 33 )下面程序中对一维坐标点类 Point 进行运算符重载#includeusing namespace std;class point {public:point ( int vaI ) {x=val;}point & operator++ () {x++;retum*this;}print operator++ ( int ) {point ld=*this,++ ( *this ) ;retum old;}int GetX () const {retum x;}private:int x;};int main (){point a ( 10 ) ;cout ( ++a ) .GetX () ;coutA++.GETX () ;retum () ;}编译和运行情况是A )运行时输出 1011B )运行时输出 1111C )运行时输出 1112D )编译有错
考题
下列语句中错误的是( )。A.const int a;B.const int a=10;C.const int*point=0;D.const int*point=new int(10);
考题
有如下程序:includeusing namespace std;class Point{public: static int number;
有如下程序:#include<iostream>using namespace std;class Point{public: static int number;public: Point(){number++;} ~Point(){number--;}};int Point::number=0;void main(){ Point*ptr; Point A,B; { Point*ptr_point=new Point[3]; ptr=pb_point; } Point C cout<<Point::number<<endl; delete[]ptr; }运行时输出的结果是A.3B.4C.6D.7
考题
下面程序中对一维坐标点类Point进行运算符重载 include using namespace std;
下面程序中对一维坐标点类Point进行运算符重载 #include <iostream> using namespace std; class Point { public: Point(int val) {x=val;} Point operator++() {x++; return *this; } Point operator++(int) {Point ld = *this; ++(*this); return old;} int GetX() const {return x;} private: int x; }; int main() { Point a(10); cout << (++a).GetX(); cout << a++.GetX(); return 0; }编译和运行情况是A.运行时输出1011B.运行时输出1111C.运行时输出1112D.编译有错
考题
有以下程序: include using namespace std; class Point' { public: void SetPoint(
有以下程序: #include <iostream> using namespace std; class Point' { public: void SetPoint(int x,int y); void Move(int xOff,int yOff); int GetX() { return X; } int GetY() { return Y; } private: int X,Y; }; void Point::SetPoint(int x, int y) { X=x; Y=y; } void Point: :Move(int xOff, int yOff) X+=xOff; Y+=yOff; } int main () { Point p1; p1.SetPoint(1,2); p1.Move (5, 6); cout<<"Point1 is ("<<p1.GetX()<<','<<p1.GetY()<<")"<<end1; return 0; } 执行后的输出结果是( )。A.Point1 is (6,8)B.Point1 is (1,2)C.Point1 is (5,6)D.Point1 is (4,4)
考题
有如下程序:#includeiostream#includecmathusing std::cout;class Point{public:friend double distance(const Point p); //P距原点的距离Point(int xx=0,int yy=0):x(xx),Y(YY){}//①private:int x,y;};double distance(const Point p){ //②return sqrt(P.x*P.x+P.y*P.y);}int main(){Point p1(3,4);coutdistance(p1);return 0; //③}下列叙述中正确的是A.程序编译正确B.程序编译时语句①出错C.程序编译时语句②出错D.程序编译时语句③出错
考题
若有语句int *point,a=4;和 point=a;,下面均代表地址的一组选项是A.a,point,*a B.和 point=a;,下面均代表地址的一组选项是A.a,point,*a B.*a,a,*point C.*point,*point,a D.a,*point,point
考题
若有语句int * point,a=4;和point=a;下面均代表地址的一组选项是()。A.a,point,*aB.a;下面均代表地址的一组选项是( )。A.a,point,*aB.*a,a,*pointC.*point,*point,aD.a, * point,point
考题
有如下程序: #inCludeiostream using namespaCe std; Class Point{ publiC: statiC int number; publiC: Point( )t.number++;} ~Point( ){number--;} }; , int P0int::number=0; int main( ){ Point *ptr: Point A,B; Point*ptr_point=new Point[3]; ptr=ptr_point;’ } Point C; CoutPoint:::numberendl; delete[]ptr; return 0; } 执行这个程序的输出结果是( )。A.3B.4C.6D.7
考题
有如下类定义:class Point{int x__, y__;public:Point(): x_(0), y_(0) {}Point(int x, int y =0): x_(x), y_(y) {}若执行语句Point a(2),b[3], *c[4];则Point 类的构造函数被调用的次数是( )。A.2次B.3次C.4次D.5次
考题
若有语句int*point,a=4;和point=a;下面均代表地址的一组选项是A.a,point,*aB.*a,a,*pointC.*point,*point,aD.a,*point,point
考题
有如下程序: include using namespace std; class point {int x,y; public:point( i
有如下程序: #include <iostream> using namespace std; class point { int x, y; public: point( int vx, int vy ) { x = vx; y = vy; } point ( ) { x = 0; y = 0; } point operator+( point pl ) { point p; int px = x + p1.x; int py = y + p1.y; return point( px, py ); } point operator-( point p1 ) { point p; int px = x - p1.x; int py = y - p1.y; return point( px, py ); } void print() { cout<<x<<", "<<y<<end1; } }; int main () { point pl ( 10, 10 ), p2 ( 20, 20 ); p1 = p1 + p2; p1.print (); return 0; } 执行后的输出结果是( )。A.10,10B.20,20C.10,20D.30,30
考题
若有以下程序:include using namespace std;define PI 3.14class Point{private: in
若有以下程序: #include <iostream> using namespace std; #define PI 3.14 class Point { private: int x,y; public: Point(int a,int b) { x=a; y=b; } int getx() { return x; } int gety() { return y; } }; class Circle : public Point { private: int r; public: Circle(int a, int b,int c) :Point(a,b) { r=c; } int getr() { return r; } double area() { return PI*r*r; } }; int main() { Circle c1(5,7,10); cout<<c1.area()<<end1; return 0; } 程序执行后的输出结果是( )。A.314B.157C.78.5D.153.86
考题
有以下类定义: class Point { public: Point(int x=0,int y=0){_x=x; _y=y;} void Move(int x Off, int y Off) {_x+=x Off; _y+=y Off; } void Print() const { cout <<'(' << _x << ',' << _y << ')'<< end 1;} private: int _x,_y; }下列语句中会发生编译错误的是______。A.Point pt; pr. Print();B.const Point pt; pt. Print();C.Point pt; pt. Move(1,2);D.const Point pt; pt. Move(1,2);
考题
若有以下程序:include using namespace std;class point{private: int x, y;public:
若有以下程序: #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;A.12,12B.5,5C.12,5D.5,12
考题
若有语句int*point,a=4;和point=a;下面均代表地址的一组选项是 A.a,point,*和 point=a;下面均代表地址的一组选项是A.a,point,*aB.*a,a,*pointC.*point,*point,aD.a,*point,point
考题
有以下说明语句:struct point{int x;int y;}p;则正确的赋值语句是()A、point.x=1;point.y=2;B、point={1,2};C、p.x=1;p.y=2;D、p={1,2};
考题
单选题下列语句中错误的是( )。A
const int a;B
const int a=10;C
const int*point=0;D
const int*point=new int(10);
考题
单选题下列语句中,错误的是( )。A
const int buffer=256;B
const double*point;C
int const buffer=256;D
double*const point;
考题
单选题有以下说明语句:struct point{int x;int y;}p;则正确的赋值语句是()A
point.x=1;point.y=2;B
point={1,2};C
p.x=1;p.y=2;D
p={1,2};
考题
单选题若有定义:int *p,a=4;p=a;则以下均代表地址的是()A
a,pB
a,pC
a,*pD
a,*p
热门标签
最新试卷