网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
若有以下程序: typedef struct S {int g;char h;}T; 以下叙述中正确的是(  )。
A

可用S定义结构体变量

B

可用T定义结构体变量

C

S是struct类型的变量

D

T是struct S类型的变量


参考答案

参考解析
解析:
AC两项,S是定义的结构体的名字,并不是struct类型的变量也不可用来定义结构体变量;D项,题目中T定义为struct S类型,即T被定义为一个类型名,而不是变量。答案选择B选项。
更多 “单选题若有以下程序: typedef struct S {int g;char h;}T; 以下叙述中正确的是(  )。A 可用S定义结构体变量B 可用T定义结构体变量C S是struct类型的变量D T是struct S类型的变量” 相关考题
考题 设有以下语句typedef struct TT{char c,int a[4];} CIN;则下面叙述中正确的是A) 可以用 TT 定义结构体变量B)TT 是 struct 类型的变量C) 可以用 CIN 定义结构体变量D)CIN 是 struct TT 类型的变量

考题 有以下程序段typedef struct node { int data; struct node *next; } *NODE;NODE p;以下叙述正确的是A)p 是指向 struct node 结构变量的指针的指针B)NODE p ;语句出错C)p 是指向 struct node 结构变量的指针D)p 是 struct node 结构变量

考题 以下结构体类型说明和变量定义中正确的是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;

考题 以下结构体类型说明和变量定义中正确的是( )。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;

考题 设有以下说明语句typedef struct{ int n;char ch[8];} PER;则下面叙述中正确的是A.PER 是结构体变量名B.PER是结构体类型名C.typedef struct 是结构体类型D.struct 是结构体类型名

考题 有以下程序includestruct STU{char name[10];int num;};void f(char*name, intnum){s 有以下程序 #include <string.h> struct STU { char name[10]; int num; }; void f(char *name, int num) { struct STU s[2]={{"SunDan",20044},{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() { struct STU s[2]={{"YangSan",20041},{"LiSiGuo",20042}},*p; p=s[1]; f(p->name,p->num); printf("%s %d\n",p->name,p->num); } 程序运行后的输出结果是A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

考题 设有以下语句: typedef street S { int g; char h;} T;则下面叙述中正确的是( )。A.可用S定义结构体变量B.可以用T定义结构体变量C.S是struct类型的变量D.T是struct S类型的变量

考题 有以下程序 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); } 程序运行后的输出结果是( )。

考题 设有以下语句: typedef struct S { int g; char h; } T; 则下面叙述中正确的是( )。A.可以用S定义结构体变量B.可以用T定义结构体变量C.S是struct类型的变量D.T是stnictS类型的变量

考题 有以下程序: include struct STU (char name[10]; int num; }; 有以下程序: #include <string.h> struct STU (char name[10]; int num; }; void f(char *name, int num) {struct STU s[2]={{"SunDan",20044}.{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() {struct STU s[2]={{"YangSall",20041},{"LiSiGao",20042}},*p;p=s[1]; f(p->name,p->num); printf("%s%d\n",p->name,p->num); } 程序运行后的输出结果是 ______。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

考题 下列程序的运行结果为【】。 include include {int a; char b[10]; double c;}; 下列程序的运行结果为【 】。include<stdio.h>include<string.h>{ int a; char b[10]; double c; };void f (struct A *t);main(){ struct A a={1001,"ZhangDa",1098.0};f(a) ; printf("%d,%s,%6.lf\n",a.a,a.b,a.C);}void f(struct A*t){ strcpy(t->b, "ChangRong");}

考题 有以下程序includeincludevoidfun(char*s[],intn){char*t;int i,j;for(i=0 有以下程序 #include <stdio.h> #include <string.h> void fun(char *s[],int n) { char *t; int i,j; for(i=0;i<n-1;++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])) {t=s[i];s[i];s[j];s[j]=t;} } main() { char *ss[]={"bccA.xy,aaaaccB.aaaacc,xyC.bcc,aabccD.aabcc,bcc

考题 以下程序的输出结果是【】。 include main() {struct stru {int a; float b; char d[4]; } 以下程序的输出结果是【 】。include<stdio.h>main(){ struct stru{ int a;float b;char d[4];};printf("%d\n",sizeof(struct stru));}

考题 设有以下说明和定义:includeVoid main() {typedef union{long i; int k[5]; char 设有以下说明和定义:#include<iostream. h>Void main() {typedef union{long i; int k[5]; char c;}DATE;struct date{iNt cat; DATE cow; double. dog;}too;DATE max;则下列语句的执行结果是( )。cout<<(sizeof(struct date)+sizeof(max))<<end1;}A.26B.52C.18D.8

考题 以下选项中,能定义s为合法的结构体变量的是( )。A.typedef struct abc { double a; char b[10]; } s;B.struct { double a; char b[10]; }s;C.struct ABC { double a; char b[10]; } ABC s;D.typedef ABC { double a; char b[10]; } ABC s;

考题 下列结构体类型说明和变量定义中正确的是( )。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;D.stmct { int n; char c;} REC; REC t1,t2;

考题 设有以下语句typedef struct S{ int g; char h; } T;则下面叙述中正确的是( )A.可用S定义结构体变量B.可以用T定义结构体变量C.S是struct类型的变量D.T是struct S类型的变量

考题 有如下程序段#include "stdio.h"typedef union{ long x[2]; int y[4]; char z[8];}atx;typedef struct aa { long x[2]; int y[4]; char z[8];} stx;main(){ printf("union=%d,struct aa=%d\n",sizeof(atx),sizeof(stx));}则程序执行后输出的结果是A.union=8,struct aa=8 B.union=8,struct aa=24C.union=24,struct aa=8 D.union=24,struct aa=24

考题 设有以下说明和定义:includeVoid main() {typedef union{long i; int k[5]; char 设有以下说明和定义: #include<iostream. h> Void main() { typedef union { long i; int k[5]; char c; } DATE; struct date {int cat; DATE cow; double dog; }too; DATE max; cout<<(sizeof(struct date)+sizeof(max))<<end1;}A.26B.52C.18D.8

考题 若有以下语句:typedef struct S{int 9;char h;}T;以下叙述中正确的是( )。A.可用s定义结构体变量B.可用T定义结构体变量C.S是struct类型的变量D.T是struct S类型的变量

考题 设有以下说明语句: typedef struct { int n; char ch[8]; }PER; 则下面叙述中,正确的是( )。A.PER是结构体变量名B.PER是结构体类型名C.typedef struct是结构体类型D.struct是结构类型名

考题 若有以下说明和定义typedef int*INTEGER:INTEGER P,*q;以下叙述正确的是

考题 以下选项中,能定义s为合法的结构件变量的是_______。A.typedef struct abc { double a; char b[10]; }s;B.struct { double a; char b[10]; }sC.struct ABC { double a; char b[10]; } ABCs;D.typedef ABC { double a; char b[10]; } ABCs;

考题 若有以下语句: typedef struct S {int g;char h;}T; 以下叙述中正确的是( )。A.可用S定义结构体变量B.可用T定义结构体变量C.S是struct类型的变量D.T是struct S类型的变量

考题 以下程序的输出结果是______。includestruct stu{int num; char name[10]; int age;};v 以下程序的输出结果是______。#include<stdio.h>struct stu{ int num; char name[10]; int age;};void fun(struct stu*p){ printf("%s\n",(*p).name);}main(){ struct stu students[3]={ {9801,"Zhang",20}, { 9802,"Wang",19}, { 9803,"Zhao",18} }; fun(students+2);}A.ZhangB.ZhaoC.WangD.18

考题 有以下程序:includeinclude struct STU {char name[10];int hum;};void f( 有以下程序:#include <stdio.h>#include <strine.h> struct STU { char name[10]; int hum;};void f(char * name,iht num){ struct STU s[2] = {{ "SunDan" ,20044} , {" Penghua" ,20045}}; num= s[0]. nnm; strepy(name,s[0], name);}main( ){ struct STU s[2] = {{"YangSan" ,20041 }, { "LiSiGao" ,20042}}, * P; p = s[1]; f(p->name,p->hum); printf("% s %d \n" ,p-> name,p->num);}程序运行后的输出结果是( )。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

考题 设有以下语句 typedef struct s {int g;char h;}T 则下面叙述中正确的是A.可用S定义结构体变量B.可以用T定义结构体变量C.S是struct类型的变量D.T是structS类型的变量