can I ask about the parameters: are the actual parameters Swap(&a, &b); and the formal, the parameters being passed to - void Swap(int *x, int *y);
Swap(&a, &b); void Swap(int *x, int *y); Swap(a, b); void Swap(int &x, int &y); Thomas Hruska <[EMAIL PROTECTED]> wrote: 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/ --------------------------------- Looking for last minute shopping deals? Find them fast with Yahoo! Search. [Non-text portions of this message have been removed]
