[求助]请教以下两题指针的远行步骤,请问能详细说明吗?万分感谢!
请教以下两题指针的远行步骤,请问能详细说明吗?万分感谢!
main() {int i,b,c,a[]={1,10,-3,-21,7,13},*pb,*pc; b=c=1;pb=pc=a; for(i=0;i<6;i++) {if(b<*(a+i)){b=*(a+i);pb=&a;} if(c>*(a+i)){c=*(a+i);pc=&a;} } i=*a;*a=*pb;*pb=i;i=*(a+5);*(a+5)=*pb;*pc=i; printf("%d,%d,%d,%d,%d,%d\n",a[0],a[1],a[2],a[3],a[4],a[5]); }
main() {struct student {char name[10]; float k1; float k2; }a[2]={{"zhang",100,70},{"wang",70,80}},*p=a; int i=1; printf("\nmame:%s total=%f",p->name,p->k1+p->k2); printf("\nmame:%s total=%f\n",a.name,a.k1+a.k2); }
[此贴子已经被天使预备役于2004-05-11 14:42:33编辑过]