https://ide.codingblocks.com/s/55722
why is this code not swapping values of variables
Https://ide.codingblocks.com/s/55722
Hi Kushagra, values are not being swapped because the function mystery() doesn’t change values, but pointers which are local to the function. It is just swapping the pointer ptra and ptrb to location pointed by ptrb and ptra respectively. Instead of swapping the pointers, you need to swap what they point to, i.e. you need to dereference them.
Refer to this code: https://ide.codingblocks.com/s/55834