xxxxxxxxxx
int x = 5;
int &y = x;
cout << "The value of x is " << x << endl;
cout << "The value of y is " << y << endl;
y++;
cout << "The value of x is " << x << endl;
cout << "The value of y is " << y << endl;
xxxxxxxxxx
\chapter[Short title for table of contents]{Long long long long long long long title}
\chaptermark{Short title for header}
xxxxxxxxxx
// C++ Program to demonstrate
// Passing of references as parameters
#include <iostream>
using namespace std;
// Function having parameters as
// references
void swap(int& first, int& second)
{
int temp = first;
first = second;
second = temp;
}
// Driver function
int main()
{
// Variables declared
int a = 2, b = 3;
// function called
swap(a, b);
// changes can be seen
// printing both variables
cout << a << " " << b;
return 0;
}