what happens when we modify the swap function this way ? I know it doesn't work but what exactly is going on ? I'm not understanding what I actually did ?
#include <stdio.h>
void swap(int*, int*);
int main(){
int x=5,y=10;
swap(&x, &y);
printf("x:%d,y:%d\n",x,y);
return 0;
}
void swap(int *x, int *y){
int* temp;
temp=x;
x=y;
y=temp;
}