mirror of
https://github.com/m1ngsama/code4sk.git
synced 2025-12-25 02:56:17 +00:00
18 lines
252 B
C++
18 lines
252 B
C++
//½ÇÉ«½»»»
|
|
#include<stdio.h>
|
|
void swap(int *px,int *py);
|
|
int main()
|
|
{
|
|
int a=1,b=2;
|
|
int *pa=&a,*pb=&b;
|
|
swap(pa,pb);
|
|
printf("After calling swap:a=%d b=%d\n",a,b);
|
|
return 0;
|
|
}
|
|
void swap(int *px,int *py)
|
|
{
|
|
int t;
|
|
t=*px;
|
|
*px=*py;
|
|
*py=t;
|
|
}
|