E
Erik
Hi,
to swap the integer variables a,b,
in Kerninghan-Ritchie I find the function example
Swap(&a,&b);
unsing a function
void swap (int *px, int *py)
{
int temp;
temp:= *px;
*px = *py;
*py = temp
}
Now here I have a problem understanding that.
The function gets two !Pointers! an arguments.
So as far as I see *px=&a will happen, but *px is an integer
variable and &a is a pointer. But I think px=&a would be
correct.
????
Thanks in advance
Erik
to swap the integer variables a,b,
in Kerninghan-Ritchie I find the function example
Swap(&a,&b);
unsing a function
void swap (int *px, int *py)
{
int temp;
temp:= *px;
*px = *py;
*py = temp
}
Now here I have a problem understanding that.
The function gets two !Pointers! an arguments.
So as far as I see *px=&a will happen, but *px is an integer
variable and &a is a pointer. But I think px=&a would be
correct.
????
Thanks in advance
Erik