#include <iostream>
int& square(int& x) {
x = x * x;
return x;
}
int square2(int& x) {
return x * x;
}
int main() {
int&& q = 5;
int& r = q;
int& s = square(r);
int t = square2(r);
std::cout << q << " " << r << " " << s << " " << t; // 25 25 25 625
}
To embed this project on your website, copy the following code and paste it into your website's HTML: