|

楼主 |
发表于 2022-3-12 17:03:40
|
显示全部楼层
A.
p2=&p1;
[Error] cannot convert 'int**' to 'int*' in assignment
B.
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int *p1,*p2,m=5,n;
- p1=&m;
- p2=&n;
- *p1=*p2;
-
- printf("&m=%d\n", &m); // &m=6487564
- printf("&n=%d\n", &n); // &n=6487560
-
- printf("p1=%d\n", p1); // p1=6487564
- printf("*p1=%d\n", *p1); // *p1=67
- printf("p2=%d\n", p2); // p2=6487560
- printf("*p2=%d\n", *p2); // *p2=67
-
-
- return 0;
- }
复制代码
C.
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int *p1,*p2,m=5,n;
-
- p1=&m;
- p2=p1;
-
- printf("&m=%d\n", &m); // &m=6487564
-
- printf("p1=%d\n", p1); // p1=6487564
- printf("*p1=%d\n", *p1); // *p1=5
-
-
- printf("p2=%d\n", p2); // p2=6487564
- printf("*p2=%d\n", *p2); // *p2=5
-
-
- return 0;
- }
复制代码
D.运行无显示 |
|