#include <stdio.h> struct test { int t; }; void in(struct test *p) { scanf("%d",&p->t); //这样呢? } int main(void) { struct test p; in(&p); printf("%d",p.t); return 0; }
2013年03月09日 14点03分
回复 龙幽灵之鬼厉 : 这样写 &p->t 要看 & 和 -> 的优先级。可以加括号明确标出。
2013年03月12日 13点03分