指针的误区

#include<stdio.h>

int main()

{

    int a =15, b = 99, c = 222;

    int *p = &a;

    printf("%d %d\n",a,*p);

    *p = b;            //此时把p指向的地址存放的a的值已经被b的值重新覆盖,a=b:

    printf("%d %d\n",a,*p);

c = *p;

    printf("%d %d %d %d\n",a,b,c,*p);

    return 0;

}

 

 
posted @ 2016-09-24 21:56  葫芦里卖药  阅读(140)  评论(0编辑  收藏  举报