标签:
typedef struct{ int a; int b; }M; int main(int argc, char *argv[]) { M c; printf("%d\n",&c); M b; printf("%d\n",&b);//b的地址 b = c;//b的值等于c printf("%d\n",&b);//b的地址未变 M* ca = (M*)malloc(sizeof(M)); ca->a = 3; M* ce = (M*)malloc(sizeof(M)); printf("%d %d ca ce\n",&ca,&ce); ce = ca;//ce的 值(指针地址) 等于ca printf("%d %d \n",&ce,ce->a);//ce的地址未变 3 return 0; }
标签:
原文地址:http://www.cnblogs.com/mattins/p/4273299.html