Skip to content

Instantly share code, notes, and snippets.

@kkabdol
Last active July 5, 2016 02:38
Show Gist options
  • Select an option

  • Save kkabdol/f692aa75da4794bf7d2c5d58bb6a73d9 to your computer and use it in GitHub Desktop.

Select an option

Save kkabdol/f692aa75da4794bf7d2c5d58bb6a73d9 to your computer and use it in GitHub Desktop.
const int vs int const
#include <iostream>
using namespace std;
int main() {
int a;
int * mutable_pointer_to_mutable_int;
int const * mutable_pointer_to_constant_int;
const int * mutable_pointer_to_constant_int2;
int *const constant_pointer_to_mutable_int = &a;
int const *const constant_pointer_to_constant_int = &a;
const int *const constant_pointer_to_constant_int2 = &a;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment