summaryrefslogblamecommitdiff
path: root/tests/exec/ref3.cpp
blob: ba58365a2d65c2b4d2f502a63e700ab31e5fc20e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                   
#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";
  f(x);
  std::cout << "x = " << x << "\n";
  x = 0;
  std::cout << "x = " << x << "\n";
  f(x);
  std::cout << "x = " << x << "\n";
}