i am trying to interchange the address of two pointers by the following code but this code doesn't change them. please tell me why is it happening and how to change it?
but when i uncomment the commented statements then it happens?
#include <iostream>
using namespace std;
void exchange ( int *ptr_a, int *ptr_b ) {
int *t;
t = ptr_a;
ptr_a = ptr_b;
ptr_b = t;
}
int main()
{
int x;
int y;
int *ptr_x;
int *ptr_y;