The Swap Function with Pointers
// The swap() function
void swap(int * x, int * y)
{
// Create a temporary variable
int temp;
temp = * x;
* x = * y;
*y = temp;
}
Previous slide
Next slide
Back to first slide
View graphic version