The Swap Function with reference
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