I am supposed to use pointers to swap ints in an array. It compiles with no errors or warnings and runs but does not swap the ints. Any suggestions would be helpful!!!
You can also swap the values without any temporary variable:
void swap(int *x, int *y) { *x ^= *y; *y ^= *x; *x ^= *y; }
then call:
swap(&ary[0], &ary[1]);