Robert Ryan wrote:
> but why someone would want to mess with pointers when C++ can 
>  handle the majority of that nonsense* behind the scenes is somewhat 
>  beyond me.   
> I thought that pass by reference in C++ used pointers

Pass "by value" (won't actually swap a and b):

Swap(a, b);

void Swap(int x, int y);


Pass "by reference":

Swap(&a, &b);

void Swap(int *x, int *y);


Swap(a, b);

void Swap(int &x, int &y);


You can use all three in C++.  Just the first two in C.  The pointer 
operations in the third are transparent and done completely behind the 
scenes.

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to