|
- #include <stdio.h>
- struct sl{
- char *s;
- struct sl *ptr;
- };
- struct sl a[]={
- {"efgh",a+1},
- {"ijkl",a+2},
- {"mnop",a}
- };
- struct sl *p=a;
- void main(){
- int i;
- for(i=0;i<3;i++)
- printf("%s %s %c %s\n",a[i].s,a[i].ptr->s,a[i].s[i]++,++p++->ptr->s+1);
- }
复制代码
结果是:
- ffgh jkl e kl
- jll nop k op
- nop fgh p gh
复制代码 |
|