Created
October 7, 2012 02:56
-
-
Save dilijev/3846938 to your computer and use it in GitHub Desktop.
Snippet from a file, playing with constants.
This file contains hidden or 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 i1 = 111; | |
int i2 = 222; | |
int i3 = 333; | |
int i4 = 444; | |
// Neither the data nor the pointer are const | |
int* a = &i1; | |
// Constant data, non-constant pointer | |
const int* b = &i2; | |
// Constant pointer, non-constant data | |
int* const c = &i3; | |
// Constant pointer, constant data | |
const int* const d = &i4; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment