Skip to content

Instantly share code, notes, and snippets.

@samueljackson92
Created April 29, 2014 08:38
Show Gist options
  • Save samueljackson92/11394168 to your computer and use it in GitHub Desktop.
Save samueljackson92/11394168 to your computer and use it in GitHub Desktop.
Constants in C++
const int* p; // the thing pointed to is const, you can change the value of p
int const *q; // same as p
int * const r; // the pointer is const, but the thing pointed to can change value
int const * const s; // the pointer is const and the thing pointed to is const
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment