Created
February 6, 2014 12:11
-
-
Save jdswinbank/8842972 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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