Last active
January 20, 2018 02:28
-
-
Save yuyu2172/871ff7b5274b67b882ccb2dd0eab34b1 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
void set_integer_ref(int& x) | |
{ | |
x = 100; | |
} | |
void set_integer_ptr(int* x) | |
{ | |
*x = 200; | |
} | |
void set_integer_ref_ptr(int*& x) | |
{ | |
x = new int[1]; | |
*x = 300; | |
} | |
void set_integer_ptr_ptr(int** x) | |
{ | |
*x = new int[1]; | |
*x[0] = 400; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment