A
apropo
#include <stdio.h>
#include <stdlib.h>
void tausche(int *a,int *b)
{
int *c=a;
a=b;
b=c;
}
int main(void)
{
int *x,*y;
*x=4;
*y=5;
tausche(x,y);
printf("x:%d,y:%d",x,y);
getch();
return 0;
}
i want this function - tausche - to switch the values stored at their
address, but it doesn't. why and how would it be correct ?
#include <stdlib.h>
void tausche(int *a,int *b)
{
int *c=a;
a=b;
b=c;
}
int main(void)
{
int *x,*y;
*x=4;
*y=5;
tausche(x,y);
printf("x:%d,y:%d",x,y);
getch();
return 0;
}
i want this function - tausche - to switch the values stored at their
address, but it doesn't. why and how would it be correct ?