#include <stdio.h>
void sw(int **dp1, int **dp2)
{
int *temp = *dp1;
*dp1 = *dp2;
*dp2 = temp;
}
int main() {
int num1=10, num2=20;
int *ptr1, *ptr2;
ptr1=&num1, ptr2=&num2;
printf("*ptr, *ptr2: %d %d \n", *ptr1, *ptr2);
sw(&ptr1, &ptr2);
printf("*ptr, *ptr2: %d %d \n", *ptr1, *ptr2);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: