Skip to content

Instantly share code, notes, and snippets.

@jdswinbank
Created February 6, 2014 12:11
Show Gist options
  • Save jdswinbank/8842972 to your computer and use it in GitHub Desktop.
Save jdswinbank/8842972 to your computer and use it in GitHub Desktop.
#include <iostream>
int& get_reference(int& a) {
return a;
}
int get_value(int x) {
return x;
}
int main(void) {
int a;
get_reference(a) = get_value(10);
std::cout << a << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment