-->
当前位置:首页 > 题库

PROGRAMMING:Pointer and address

Luz5年前 (2021-05-10)题库341
```
Analyze the following code to understand the pointer and address.
#include
int main(){
int a=5,b=8,t;
int *pa,*pb;
pa=&a; pb=&b;
printf("%ld,%ld\n",&a,&b);
printf("%ld,%ld\n",pa,pb);
t=*pa; * pa=*pb; * pb=t;
printf("%d,%d\n",a,b);
return 0;
}
```
According to the code on the ground, the program reads in two integers, exchanges the value of the variable with the pointer, and outputs the value before and after the exchange respectively.
###Input example:
```in
5 8
```
###Output example:
```out
a=5,b=8
a=8,b=5
```







answer:If there is no answer, please comment