相关题目
下面程序的运行结果是( )。
main ( )
{ struct cmplx { int x;
int y;
} cnum[2]={ 1 , 3 , 2 , 7 };
printf ("%d\n", cnum[0].y/cnum[0].x*cnum[1].x);
}
若有以下定义和语句:
struct student
{ int age;
int num;
};
struct student stu[3]={{1001,20},{ 1002,19},{1003,21}};
main( )
{ struct student *p;
p=stu;
…
}
则以下不正确的引用是( )。
以下scanf 函数调用语句中对结构体变量成员的不正确引用是( )。
struct pupil
{ char name[20];
int age;
int sex;
} pup[5],*p;
p=pup;
有以下定义和语句, 则值为6 的表达式是( )。
struct s
{ int i1;
struct s *i2;
};
static struct s a[3]={5,&a[1],7,&a[2],9,'\0'},*ptr;
ptr=&a[0];
设有如下定义:
struct sk
{int n;
float x;
} data,*p;
若要使p指向data中的n域, 正确的赋值语句是( )。
若有以下说明和语句:
struct student
{ int age;
int num;
} std,*p;
p=&std;
则以下对结构体变量std 中成员age 的引用方式不正确的是( )。
若有以下程序段:
struct student
{
int num ;
int age ;
}
struct student stu[3]={{101,20},{102,19},{103,20}};
main( )
{ struct student *p;
p=stu;
…
}
则以下引用形式不合法的是( )。
若有以下说明和语句, 则在scanf 函数调用语句中对结构体变量成员的不正确引用方式是( )。
struct pupil
{ char name[20];
int age;
int sex;
}pup[5],*p;
p = pup;
以下程序的输出结果是( )。
struct stu
{ int x;
int *y;
} *p;
int dt[ 4 ]={ 10 , 20 , 30 , 40 } ;
struct stu a[ 4 ]={ 50 , &dt [ 0] , 60 , &dt [1] ,70 , &dt [ 2] , 80 , &dt [ 3 ]};
main ( )
{ p = a ;
printf (“%d”,++p->x ) ;
printf (“%d”,(++p)->x) ;
printf (“%d\n”,++(*p->y)) ;
}
若有以下说明和语句, 则下面引用形式中不正确的是( )。
struct student
{ int age ;
int num;
} ;
struct student stu [ 3 ] = {{1001 , 20 } , { 1002 , 19 } , { 1003 , 21 } } ;
struct student *p ;
p = stu ;
