2022.3.9 &取地址操作符 *--解引用操作符

#include <stdio.h>
int main()//&取地址操作符    *--解引用操作符
{
    int a=10;//p的类型为int
    int*p=&a;//有一种变量是用来存放地址的---指针变量P
    printf("%p\n",&a);//0028FF40
    printf("%p\n",p);//0028FF40
    *p=20;//*--解引用操作符   *p--找到所指向对象a   20--通*p找到a的值改成20
    printf("a=%d\n",a);//结果为20
    return 0;
}

posted @ 2022-03-09 21:27  抢你红包  阅读(75)  评论(0)    收藏  举报