summaryrefslogtreecommitdiff
path: root/tests/exec/ref4.cpp
blob: 4f59ef4dc484beef4d52e6e925f546a24d85407b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>

void f(int &y) {
  y = y + 1;
}

int main() {
  int x = 41;
  std::cout << "x = " << x << "\n";
  f(x);
  std::cout << "x = " << x << "\n";
  int &z = x;
  f(z);
  std::cout << "x = " << x << "\n";
  std::cout << "z = " << z << "\n";
}