Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void swap(int* num1,int* num2);
- int main (void){
- int x=1,y=2;
- int* px;
- int* py;
- px=&x;
- py=&y;
- swap(px,py);
- printf("%d\n",x);
- printf("%d",y);
- }
- void swap(int* num1,int* num2)
- {
- int temp;
- temp=*num1;
- *num1=*num2;
- *num2=temp;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement