首页/ 题库 / [单选题]有以下说明语句:struct point的答案

有以下说明语句:struct point{int x;int y;}p;则正确的赋值语句是()

单选题
2022-03-26 23:16
A、point.x=1;point.y=2;
B、point={1,2};
C、p.x=1;p.y=2;
D、p={1,2};
查看答案

正确答案
C

试题解析

标签: 大学试题 工学
感兴趣题目
设有说明语句:int x=8,y=9; 表达式x/=(y-y/5)的值为 ( )
若有下列说明和语句,则对结构体变量st中成员i的引用方式不正确的是( )。 Struct stu { int i; int name; }st,*p; p=&st;
有以下说明语句:struct Worker{int no;char name[20];};Worker w,*p=&w;则下列错误的引用是()
有以下程序 struct s { int x,y; } data[2]={10,100,20,200}; main() struct s *p=data; printf("%d ",++(p->x)); 程序运行后的输出结果是
有以下程序: #include <stdio.h> struct s { int x,y;} data[2]={10,100,20,200}; main() { struct s *p=data; printf("%d ",++(p->x)); 程序运行后的输出结果是( )。
若有以下定义和语句 union date { int i; char c; fioat f;} x; int y; 则以下语句正确的是______。
有以下说明和定义语句struct student{ int age;char num {8};};struct student stu[3]={{20,“200401”},{21,“200402”),{19,“200403”}};struct student *p=stu; 以下选项中引用结构体变量成员的表达式错误的是
有以下说明和定义语句 struct student { int age;char num[8]; struct student stu[3]={{20,"200401"},{21,"200402"},{19,"200403"}}; struct student *p=stu;}; 以下选项中引用结构体变量成员的表达式错误的是
若有以下定义的语句 struct student {int age; int num;}; struct student stu[3]={{1001,20},{1002,19},{1003,21}}; main() {stmct student *p; p=stu; …} 则以下不正确的引用是
以下程序执行后的输出结果是( )。 #include <iostream> using namespace std; void try(int,int,int,int); int main ( ) { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = X*X; y = y*y; r = z+x+y; }
以下程序执行后的输出结果是 #include<iostream> using namcspace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = x*x; y = y*y; r = z+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 {pri
相关题目
设有说明语句:int x=8,y=9; 表达式x/=(y-y/5)的值为 ( )
若有以下结构体定义,则______是正确的引用或定义。 struct example { int x; int y; }v1;
若有以下结构体,则正确的定义或引用的是struct Test{int x;int y;} vl;
执行以下语句的结果为______。 int x=3,y;int*px=&x;y=*px++;
以下程序执行后的输出结果是 #include <iostream> using namespace std; void try(int,int,int,int); int main () { int x,y,z,r; x =1 ; y = 2; try(x,y,z,r); cout<<r<<endl; return 0; } void try(int x,int y,int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }
以下程序执行后的输出结果是( )。 #include<iostream> using namespace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<endl; return 0; } void try(int x,int y, int z,int r) { z = x+y; X = x*x; y = y*y; r = z+x+y; }
有以下程序: void f(int y,int *x) { y=y+ *x; *x;=*x+y;} main() { int x=2,y=4; f(y,&x); - printf ("%d %d ",x,y); } 执行后的输出结果是 ______。
若有以下程序: #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() { reurn 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 cl(5,7,10); cout<<c 1 .area()<<end1; return 0; } 程序执行后的输出结果是
若有以下程序: #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; } 程序执行后的输出结果是( )。
设有以下说明语句 typedef struct { int n; char ch[8]; }PER;
设有如下说明:typedef struct{int n;char c;double x;}STD;有以下选项,能正确定义结构体数组并赋初值的语句是( )。
若有以下程序: #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;
试题15若有定义语句:int x=12,y=8, z; , 在其后执行语句z=0.9+x/y; , 则z 的值为()
若有定义 int x=3,y;则执行语句y=(x++)+(x++)+(x++)后,y=( )。
有以下程序 #include<stdio.h> struct ord { int x,y;} dt[2]={1,2,3,4}; mare() { struct ord*p=dt; printf("%d,",++p->x); printf("%d ",++p->y); } 程序的运行结果是______。
设有以下C语言说明语句,则值为210的表达式是(33)。 struct s { int a;int *b;}; Int x0[]={110,120},x1[]={210,220}; struct s x[]={{100},{200}},*p=x; x[0].b=x0;x[1].b=x1;
有说明语句int x[4][5];void fun(int y[4][5] ,int m,int n);调用函数的正确语句是()
有以下说明语句:struct point{int x;int y;}p;则正确的赋值语句是()
有说明语句int a[10];及函数int fun(int x[10],int n){return sizeof(x);},则语句cout<<><>
有说明语句int *p=new int[10];释放动态数组的正确语句是()
广告位招租WX:84302438

免费的网站请分享给朋友吧