帮解释下每个语句意思?答案是怎么选的?指针引用怎么用,迷茫,又将这的连接给我也行2.There are the following definition:int x=100,y;int *p1;const int *p2=&x;Which of the following statements is incorrect (C )A.p1=&x;
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/08 18:07:18
![帮解释下每个语句意思?答案是怎么选的?指针引用怎么用,迷茫,又将这的连接给我也行2.There are the following definition:int x=100,y;int *p1;const int *p2=&x;Which of the following statements is incorrect (C )A.p1=&x;](/uploads/image/z/11377200-48-0.jpg?t=%E5%B8%AE%E8%A7%A3%E9%87%8A%E4%B8%8B%E6%AF%8F%E4%B8%AA%E8%AF%AD%E5%8F%A5%E6%84%8F%E6%80%9D%3F%E7%AD%94%E6%A1%88%E6%98%AF%E6%80%8E%E4%B9%88%E9%80%89%E7%9A%84%3F%E6%8C%87%E9%92%88%E5%BC%95%E7%94%A8%E6%80%8E%E4%B9%88%E7%94%A8%2C%E8%BF%B7%E8%8C%AB%2C%E5%8F%88%E5%B0%86%E8%BF%99%E7%9A%84%E8%BF%9E%E6%8E%A5%E7%BB%99%E6%88%91%E4%B9%9F%E8%A1%8C2.There+are+the+following+definition%3Aint+x%3D100%2Cy%3Bint+%2Ap1%3Bconst+int+%2Ap2%3D%26x%3BWhich+of+the+following+statements+is+incorrect+%EF%BC%88C+%EF%BC%89A.p1%3D%26x%3B)
帮解释下每个语句意思?答案是怎么选的?指针引用怎么用,迷茫,又将这的连接给我也行2.There are the following definition:int x=100,y;int *p1;const int *p2=&x;Which of the following statements is incorrect (C )A.p1=&x;
帮解释下每个语句意思?答案是怎么选的?指针引用怎么用,迷茫,又将这的连接给我也行
2.There are the following definition:
int x=100,y;
int *p1;
const int *p2=&x;
Which of the following statements is incorrect (C )
A.p1=&x; B.p1=p2;
C.p2=p1; D.p2=&y;
帮解释下每个语句意思?答案是怎么选的?指针引用怎么用,迷茫,又将这的连接给我也行2.There are the following definition:int x=100,y;int *p1;const int *p2=&x;Which of the following statements is incorrect (C )A.p1=&x;
int x = 100,y; //定义两个整型变量,并对x赋初值100
int *p1; //定义一个指向整型变量的指针p1
const int *p2 = &x; //定义一个常变量,类型是指向整型变量的指针p2,并将x的地址赋给p2,const关键字,是一个C语言的关键字,它限定一个变量不允许被改变
A选项:将变量x的地址赋值给指针p1
B选项:将指针变量p2的值赋值给指针变量p1,此时两个指针变量同时指向变量x
C选项:将指针变量p1的值赋值给指针变量p2.错误1,p2的值是不允许改变的;错误2,p1指针无确定指向,不能作为赋值语句的右值进行赋值运算.
D选项:将变量y的地址赋值给指针变量p2.错误点,p2的值是不允许改变的