Q:

Problem with passing pointers as argument in user defined function in c++

I have been trying to understand the way pointers are passed as arguments.  I have seen in my course book that pointers and arrays are by default passed as reference but the following program gave me unexpected result.  
I expected:
Second&First
Second*First

But the output is:
Second&First
First*Second

Is my concept wrong or is there any special trick in this program.  Please clear the concept of pointers. 
void Alter(char* X, char* Y){
char* T;
cout<<"&S1="<<&X<<"&S2="<<&Y<<endl;
T=X;
X=Y;
Y=T;
cout<<X<<"&"<<Y<<endl;}

void main(){
char X[]="First", Y[]="Second";
cout<<"&x="<<&X<<"&y="<<&Y<<endl;
Alter(X,Y);
cout<<"&x="<<&X<<"&y="<<&Y<<endl;
cout<<X<<"*"<<Y;getch();}

A:

The output is correct.  Your expectation is somewhat different from the actual behaviour. 
Whenever it comes to pointers, always treat them as variables that contain some memory address. 
See step by step, what is happening. 
1) char X[]="First", Y[]="Second";
----------------
|      F       | <--- X
----------------

...

----------------
|      S       | <--- Y
----------------

2) cout<<"&x="<<&X<<"&y="<<&Y<<endl;
Addresses of pointers X and Y are outputted onto the screen. 
3) Alter(X,Y);
On execution of this function call, pointers X and Y are copied to the parameters of the Alter function, say, X' and Y'
----------------
|      F       | <--- X, X'
----------------

...

----------------
|      S       | <--- Y, Y'
----------------

4) T=X; X=Y; Y=T;
On execution of this code, X' and Y' pointers are swapped. 
----------------
|      F       | <--- X, Y'
----------------

...

----------------
|      S       | <--- Y, X'
----------------

5) cout<<X<<"&"<<Y<<endl;
As you can see in Step 4, Because X' points to memory location containing 'S', 'Second' is printed first and 'First' is printed later. 
6) cout<<"&x="<<&X<<"&y="<<&Y<<endl;
Before execution of this instruction, the parameters of Alter function have become out of scope. 
So, Now, the scenario is like this:
----------------
|      F       | <--- X
----------------

...

----------------
|      S       | <--- Y
----------------

7) cout<<X<<"*"<<Y;
As you can see in Step 6, Because X points to memory location containing 'F', 'First' is printed first and 'Second' is printed later.