求助,被指向指针的指针弄迷糊了,下面的程序怎么也读不明白
程序代码:
#include<stdio.h> char x,y,z; void assp(char **p,char pref); main() { char *a,*b,*c,ta,tb,tc; printf("请输入三位男士的选择对象:\n"); scanf("%c%c%c",&ta,&tb,&tc); getchar(); assp(&a,ta); assp(&b,tb); assp(&c,tc); printf("请输入三位女士的选择对象:\n"); scanf("%c%c%c",&x,&y,&z); if(*a=='a')printf("A is LUCKY\n"); if(*b=='b')printf("B is LUCKY\n"); if(*c=='c')printf("C is LUCKY\n"); } void assp(char **p,char pref) { switch(pref) { case 'x':*p=&x;break; case 'y':*p=&y;break; case 'z':*p=&z;break; } }