Last active
July 5, 2016 02:38
-
-
Save kkabdol/f692aa75da4794bf7d2c5d58bb6a73d9 to your computer and use it in GitHub Desktop.
const int vs int const
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
| #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