Object-Oriented Programming in C++

Code display of PL2/byreference3.cpp

// PL1/byreference3.cpp
// Use of a reference variable
// Niels Walet, last updated 04/12/2019
#include<iostream> 
int main() 
{ 
  int number{4}; 
  int &reference{number}; 
  std::cout<<number<<" "<<reference<<std::endl; 
  number++; 
  std::cout<<number<<" "<<reference<<std::endl; 
  return 0;
}

Download here; To copy and paste: double click inside code, then copy.