有以下说明语句: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};

有以下说明语句: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)struct ord {int x;int y;int z;}; struct ord a;B)struct ord {int x;int y;int z;} struct ord a;C)struct ord {int x;int y;int z;} a;D)struct {int x;int y;int z;} a;

有如下类定义: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 次

有以下类定义 classPoint{ public: Point(int x=0,int y=0){_x=x;_y=y;} void Move (int xOff,int yOff {_x +=xOff;_y+yOff} void Print() const {cout<<'('<<_x<<','<<_y<<')'<<endl;} private: int_x_y; }; 下列语句中会发生编译错误的是A.Pointpt;pt;Print();B.const Point pt;pt.Print();C.Pointpt;pt.Move(1,2);D.const Point pt;pt.Move(1,2);

下列语句段中,正确的是( )。A.struct{int x;float y;int a[2];unsigned b[3];char name[10];};B.struct stu{unsigned a[3];unsigned b[4];}x;int*p=x.a;C.struct stu{int a;float x[4];}y={1,1.0};float data=y.x;D.struct nd{int a,b;unsigned c[2]=5;};

下面结构体的定义语句中,错误的是( )。A.struct ord{int x;int y;int z;};struct ord a;B.struct ord{int x;int y;int z;};ord a;C.struct ord{int x;int y;int z;}a;D.struct{int x;int y;int z;}a;

以下正确的函数原型语句是( )。A、double fun(int x,int y)B、double fun(int x;int y)C、double fun(int,int);D、double fun(int x,y);

下面结构体的定义语句中,错误的是( )。 A.struct ord{int x;int Y;int Z;};struet ord a;SXB 下面结构体的定义语句中,错误的是( )。A.struct ord{int x;int Y;int Z;};struet ord a;B.struct ord{int x;int y;int Z;}struct ord a;C.struct ord{int X;int Y;int Z;}a;D.struct{int X;int y;int Z;}a;

有以下程序: 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)

有以下程序 include struct tt { int x; struct tt *y; } *p; s 有以下程序 #include <stdio.h> struct tt { int x; struct tt *y; } *p; struct tt a[4]= {20,a+ 1,15,a+2,30,a+3,17,a}; main() { int i; p=a; for(i=1; i<-2; i++) { printf("%d,", p->x ); p=p->y; }A.20,30,B.30,17C.15,30,D.20,15,

有以下程序:includeusingnamespacestd;definePI3.14classPoint{private: intx,y;pub 有以下程序: #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<<cl.area()<<endl; return 0; } 程序执行后的输出结果是A.314B.157C.78.5D.153.86

有以下程序:includeusing namespace std;definePl 3.14Class Point{private:int x,y 有以下程序: #include<iostream> using namespace std; #definePl 3.14 Class Point {private: int x,y; public: Point(int a,intB) {X=a; y:b;} int getx() <return x;} int gety() {return y;}}; class Circle:public Point {priA.314B.157C.78.5D.153.86

下面结构体的定义语句中,错误的是A.struct ord{int x;int y;int z;};struet ord a;B.atruet ord{int x;int y;int z;}struct ord a;C.struet ord{int x;int y;int z;}a;D.struct{int x;int y;int z;)a;

有如下类定义: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次

下面结构体的定义语句中,错误的是( )。A.struct ord{int x;int Y;int z;}struct ord a;B.struct ord{int x;im Y;im z;};struct ord a;C.struct ord{int x;int Y;int Z;}a;D.struct{int x;int Y;int z;}a;

有以下程序:include using namespace std;define PI 3.14class Point{ private:int 有以下程序: #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; }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);

下列语句段中,正确的是( )。A.street { int x; float y; int a[2]; unsigned b[3]; char name[ 10]; };B.struct stu { unsigned a[3]; unsigned b[4]; }x; int *p= x.a;C.stmct stu { int a; float x[4]; }y={1,1.0}; float data=y.x;D.struct nd { int a,b; unsigned c[2]=5; };

若有以下程序: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

下列语句段中,正确的是( )。A.struct { int x; float y; int a[2]; unsigned b[3]; char name[ 10]; };B.struct stu { unsigned a[3]; unsigned b[4]; }x; int *p= x.a;C.street stu { int a; float x[4]; }y={1,1.0}; float data=y.x;D.struct nd {int a,b; unsigned c[2]=5; };

有以下类定义 class Point{ public: Point{int x = 0, int y=0) {_x = x; _y = y;} void Move int xoff, int yoff) {_x +=xoff;_y+=yoff;} void Print() const {cout<<'('<<_x<<','<<_y<<')' << end1;} private: int_x,_y; }; 下列语句中会发生编译错误的是A.Point pt;pt.Print();B.const Point pt;pt.Print();C.Point pt;pt.Move(1, 2);D.const Point pt;pt.Move(1, 2)

试完成下述程序片段:public class Point(){ int x,y;public Point(int x,int y){ =x; =y;}......} A. Point.x Point.yB.无解C. x1 y1D.this.x this.y

有以下说明语句:struct Point{int x;int y;};则叙述正确的是()A、正确的结构类型说明B、正确的结构变量说明C、错误的原因是结构中成员类型相同D、无意义的说明

在下面C语言的函数说明语句中,正确的是()。A、int fun(int x, int y);B、int fun(int x,y);C、int fun(x,y);D、int fun(int x; int y);

单选题下面结构体的定义语句中,错误的是(  )。Astruct ord{int x;int y;int z;};struct ord a;Bstruct ord{int x;int y;int z;}struct ord a;Cstruct ord{int x;int y;int z;}a;Dstruct {int x;int y;int z;}a;

单选题有以下说明语句:struct Point{int x;int y;};则叙述正确的是()A正确的结构类型说明B正确的结构变量说明C错误的原因是结构中成员类型相同D无意义的说明

单选题有以下说明语句:struct point{int x;int y;}p;则正确的赋值语句是()Apoint.x=1;point.y=2;Bpoint={1,2};Cp.x=1;p.y=2;Dp={1,2};

单选题在下面C语言的函数说明语句中,正确的是()。Aint fun(int x, int y);Bint fun(int x,y);Cint fun(x,y);Dint fun(int x; int y);