Created
September 21, 2016 07:43
-
-
Save mumreg/701c54dff500954552e71f69369e4953 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> | |
class A { | |
public: | |
A(int i) : a(i) {} | |
int a; | |
int& GetA() { return a; } | |
}; | |
int main(int argc, const char * argv[]) { | |
A theA(10); | |
auto test = theA.GetA(); | |
test = 20; | |
std::cout << "a: " << theA.a << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment