网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
设有如下定义,若要通过px引用rec中的x域,正确的语句()。 struct aa { int x; float y; } rec, *px; px=&rec;
A.px.x;
B.px->x;
C.*px->x;
D.*px.x;
参考答案和解析
C
更多 “设有如下定义,若要通过px引用rec中的x域,正确的语句()。 struct aa { int x; float y; } rec, *px; px=rec;A.px.x;B.px->x;C.*px->x;D.*px.x;” 相关考题
考题
以下结构体类型说明和变量定义中正确的是A)typedef struct{int n; char c;} REC;REC t1,t2;B)struct REC;{int n; char c;};REC t1,t2;C)typedef struct REC ;{int n=0; char c='A';} t1,t2D)struct{int n;char c;}REC;REC t1,t2;
考题
(16)若有定义语句:double x,y,*px,*py,执行了px=x, py=y;之后,正确的输入语句是A)scanf(“%f%f”,x,y); B) scanf(“%f%f”,x,y);C) scanf(“%lf%le”,px,py); D) scanf(“%lf%lf”,x,y);
考题
有以下程序#include stdio.htypedef struct{ int num;double s ; }REC;void fun1( REC x ){x.num=23; x.s=88.5;}main(){ REC a={16,90.0 };fun1(a);printf("%d\n",a.num);}程序运行后的输出结果是 【 1 4 】 。
考题
下列语句段中,正确的是( )。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.typedef structB.struct REC; {int n;char c;}REC; {int n;char c;}; REC t1,t2; REC t1,t2;C.typedef struct REC;D.struct {int n=0;char c='A';}t1,t2; {int n;char c;}REC; REC t1,t2;
考题
有以下程序includestdio.htypedef struct{int num;double s;}REC;void funl(REC x){x.nllm=23;x.s=88.5;}main( ){REC a={16,90.0);funl(A);prinff(“%d\n”,a.num);}程序运行后的输出结果是【 】。
考题
设有如下定义: struct sk { int a;float b; } data; int *p; 若要使p指向data中的a域,正确的赋值语句是( )。A.p=a;B.p=data.a;C.p=data.a;D.p=a;
考题
有以下程序 include typedef struct { int num;double s; }REC; void funl(REC *x) { x
有以下程序 include<stdio.h> typedef struct { int num;double s; }REC; void funl(REC *x) { x->num=23;x->s=88.5; } void main() { REC a={16,90.0}; fun1(A); printf("%d\n",a.num); } 程序运行后的输出结果是( )。
考题
设int x:,则经过______ 后,语句*px=0;可将x值置为0。A.int*px;B.int const *px=x;C.int* const px=x:D.const int *px=x;
考题
若有定义语句:doub1e x,y,*px,*py;执行了px=x;py=y;之后,正确的输入语句是______。A.scanf("%f%f"x,y);B.scanf("%f%f"x,y);C.scanf("%1f%lf",px,y);D.scanf("%lf%lf",x,y);
考题
设有如下定义:struct sk{ int n;float x; } data, *p;若要使p指向data中的n域,正确的赋值语句是A.p=data.n;B.*p=data.n;C.p=(struct sk*)data.n;D.p=(struct sk*)data.n;
考题
有如下程序:include using namespace std;class point{int x, y;public:point( int v
有如下程序:#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 p1 ) { 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 p1( 10, 10 ), p2( 20, 20 ); p1 = p1 + p2; p1.print(); return ();}执行后的输出结果是( )。A.10, 10B.20, 20C.10, 20D.30, 30
考题
若有定义语句“doublex,y,*px,*Py;执行了px=&x;py=&y;”后,正确的输入语句是( )。A.scanf("%f%f",x,y);B.scanf("%f%f"&x,&y);C.scanf("%If%le",px,py);D.scanf("%lf%If"x,y);
考题
若有定义语句:double x,y,*px,*PY;执行了laX=&x;lay=&y;之后,正确的输入语句是( )。A.scanf(”%If%le”,px,lay);B.seanf(”%f%f¨&x,y);C.seanf(”%f%f",x,y);D.Scanf(”%If%If"·,x,y):
考题
若有定义语句:正确的输入语句是( )。A.scanf(”%lf%If"’,X,Y);B.scanf(”%f%f¨X,Y);C.scanf(”%f%f¨,X,y);D.scanf(”%lf%le”,px,PY);
考题
有如下程序: 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
考题
单选题以下结构体类型说明和变量定义中正确的是( )。A
typedef struct{int n;char c;}REC; REC t1,t2;B
struct REC;{int n;char c;}; REC t1,t2;C
typedef struct REC:{int n=0;char c = 'A';} t1,t2; REC t1,t2;D
struct{int n;char c;}REC;
考题
单选题若有定义语句double x,y,*px,*py;执行了px=x;py=y;之后,输入语句正确的是( )。A
scanf("%f%f",x,y);B
scanf("%f%f"x,y);C
scanf("%1f%1e",px,py);D
scanf("%1f%1f",x,y);
考题
单选题若有定义语句:double x,y,*px,*py;执行了px=x;py=y;之后,正确的输入语句是( )。A
scanf(%1f%1f,px,py);B
scanf(%f%fx,y);C
scanf(%f%f,x,y);D
scanf(%1f%1f,x,y);
热门标签
最新试卷