#include <iostream> void foo(int &x) { x = 10;} int main() { int x = 512; foo(x); std::cout << x << std::endl;}
Standard input is empty
10
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!