一个例子告诉你指针有多危险 代码 #include <stdio.h> int main() { struct st { int a; int b; }; struct st st1; st1.a=1; st1.b=4; int *pa=&(st1.a); printf("a=%d,b=%d\n",st1.a,st1.b); pa[1]=77; printf("a=%d,b=%d\n",st1.a,st1.b); return 0; } 运行结果 a=1,b=4 a=1,b=77