全部知识点
第4601题
有以下程序:
#include<stdio.h>
struct S{int a;int *b;};
main()
{
int x1[] = {3,4},x2[] = {6,7};
struct S x[] = {1,x1,2,x2};
printf("%d,%d\n",*x[0].b,*x[1].b);
}程序的运行结果是()。
第4602题
若有以下定义:
struct tt{char name[10];char sex;} aa={"aaaa",'F'},*p=&aa;则错误的语句是()。
第4603题
有以下结构体说明、变量定义和赋值语句
struct STD
{
char name[10];
int age;
char sex;
}s[5],*ps;
ps = &s[0];则以下scanf函数调用语句有错误的是()。
第4604题
有如下定义:
struct st
{
char name[12];
int age;
char sex;
}std[10], *p=std;以下语句错误的是()。
第4605题
有如下程序:
struct person
{
char name[10];
char sex;
float weight;
}zhangsan, *ptr;
ptr=&zhangsan;若要从键盘读入姓名给结构体变量zhangsan的name成员,输入项错误的是()。
第4606题
设有定义:
struct
{
char mark[12];
int num1;
double num2;
}t1,t2;若变量均已正确赋初值,则以下语句中错误的是()。
第4607题
以下叙述中正确的是()。
第4608题
有如下程序:
#include <stdio.h>
struct S
{
int x,y;
};
main()
{
struct S data[2] = {4,3,1,9};
int i;
for(i=0;i<2;i++)
printf("%d,%d;",data[i].x, data[i].y>>1);
}程序运行后的输出结果是()。
第4609题
有以下程序:
#include <stdio.h>
struct S
{
int x,y;
};
main()
{
struct S data[3] = {4,3,2,0,8,1};
int i;
for(i=0;i<3;i++)
printf("%d%d;",data[i].x, data[i].y>>1);
printf("\n");
}程序运行后的输出结果是()。
第4610题
有如下程序:
#include <stdio.h>
struct person
{
char name[10];
int age;
};
main()
{
struct person room[2] = {{"Wang",19},{"Li",20}};
printf("%s:%d\n",(room+1)->name, room->age);
}程序运行后的输出结果是()。
第4611题
有以下程序
#include <stdio.h>
struct tt
{
int x;
} *sp;truct tt *y;
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;
}
}程序的运行结果是()。
第4612题
有以下程序:
#include <stdio.h>
struct st
{ int x,y;} data[2]={1,10,2,20};
main()
{
struct st *p=data;
printf("%d,",p->y);
printf("%d\n",(++p)->x);
}程序运行的结果是()。
第4613题
有以下程序:
#include<stdio.h>
struct ord
{int x,y;}dt[2]={1,2,3,4};
main()
{
struct ord *p=dt;
printf("%d,",++(p->x));
printf("%d\n",++(p->y));
}程序运行后的输出结果是()。
第4614题
有以下程序:
#include <stdio.h>
struct S
{
int a,b;
}data[2]={10,100,20,200};
main()
{
struct S p=data[1];
printf("%d\n",++(p.a));
}程序运行后的输出结果是()。
第4615题
有以下程序:
#include <stdio.h>
#include <string.h>
struct S
{
char name[10];
};
main()
{
struct S s1,s2;
strcpy(s1.name,"XXX");
strcpy(s2.name,"=");
s1=s2;
printf("%s\n",s1.name);
}程序运行后的输出结果是( )。
第4616题
有以下程序:
#include <stdio.h>
#include <string.h>
struct S
{
char name[10];
};
main()
{
struct S s1,s2;
strcpy(s1.name,"12345");
strcpy(s2.name,"ABC");
s1=s2;
printf("%s\n",s1.name);
}程序运行后的输出结果是( )。
第4617题
有以下程序
#include <stdio.h>
typedef struct
{
int b,p;
}A;
void f(A c)
{
int j;
c.b+=1;
c.p+=2;
}
main()
{
int i;
A a={1,2};
f(a);
printf("%d,%d\n",a.b,a.p);
}程序运行后的输出结果是( )。
第4618题
有如下程序:
#include <stdio.h>
struct person
{
char name[10];
int age;
};
main()
{
struct person room[4] = {{"Zhang",19}, {"Li",20}, {"Wang",17},
{"Zhao",18}};
printf("%s:%d\n",(room+2)->name, room->age);
}程序运行后的输出结果是()。
第4619题
有以下程序:
#include <stdio.h>
#include <string.h>
typedef struct
{
char name[9];
char sex;
float score[2];
} STU;
void f(STU *A)
{
strcpy(a->name,"Zhao");
a->sex='m';
a->score[1]=90.0;
}
main()
{
STU c = {"Qian",'f',95.0,92.0},*d=&c;
f(d);
printf("%s,%c,%2.0f,%2.0f\n", d->name, c.sex, c.score[0], c.score[1]);
}程序的运行结果是()。
第4620题
有以下程序:
#include <stdio.h>
main()
{
struct STU
{
char name[9];
char sex;
double score[2];
}st;ruct STU a = {"Zhao",'m',85.0,90.0}, b={"Qian",'f',95.0,92.0};
b=a;
printf("%s,%c,%2.0f,%2.0f\n", b.name, b.sex, b.score[0], b.score[1]);
}程序运行的结果是()。