#include <iostream>
int main() {
int x = 10;
// Create a const reference to x
const int& ref = x;
std::cout << "ref = " << ref << "\n";
// ref = 20; // ERROR: cannot modify through const reference
x = 30; // modifying the original variable is allowed
std::cout << "ref now sees: " << ref << "\n";
}
/*
run:
ref = 10
ref now sees: 30
*/