Skip to content

Instantly share code, notes, and snippets.

@dilijev
Created October 7, 2012 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dilijev/3846938 to your computer and use it in GitHub Desktop.
Save dilijev/3846938 to your computer and use it in GitHub Desktop.
Snippet from a file, playing with constants.
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