-
-
Save fabiogaluppo/659b242782b83ae85726 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
int z = 4; | |
int& w = z; | |
auto w1 = z; //int | |
std::cout << z << " " << w << " " << w1 << "\n"; //4 4 4 | |
w = 16; | |
std::cout << z << " " << w << " " << w1 << "\n"; //16 16 4 | |
w1 = 256; | |
std::cout << z << " " << w << " " << w1 << "\n"; //16 16 256 | |
auto& w2 = z; //int& | |
w2 = 65536; | |
std::cout << z << " " << w << " " << w2 << "\n"; //65536 65536 65536 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment