10、有以下定义和语句,则表达式++pr>i的值为6 struct s i int i; int all={1,2,3,4,5,6}; sa3]={5,&al1l7,&a2],9,"0"},ptr; void maino ptr=&a; C++程序设计课件设计制作:徐龙琴
C++程序设计课件 设计制作:徐龙琴 6 10、有以下定义和语句,则表达式++ptr->i 的值为 struct s { int i; int *j; }; int a[]={1,2,3,4,5,6}; s a[3]={5,&a[1],7,&a[2],9,'\0'},*ptr; void main() { … ptr=&a[0]; … } 6
二读程题: °# include< stdio.h> struct two f x, *y ;*p; inta8={1,2,3,4,5,6,7,8}; twob|4]={100,&a[1,200,.a3],10,.al5l,20,.a[7]}; void main (0 程序的运行结果为: {p=b; 101 printf("%od\n",++(p->x)); C++程序设计课件设计制作:徐龙琴 7
C++程序设计课件 设计制作:徐龙琴 7 二 读程题: 1. #include <stdio.h> struct two { int x, *y ; }*p; int a[8]={1,2,3,4,5,6,7,8}; two b[4]={100,&a[1],200,&a[3],10,&a[5],20,&a[7]}; void main() { p=b; printf("%d\n",++(p->x)); } 程序的运行结果为: 101