Created
July 23, 2018 07:22
-
-
Save geekoff7/271147584fea02efbc7c1aabf7e1f639 to your computer and use it in GitHub Desktop.
const char
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
char* is a mutable pointer to a mutable character/string. | |
const char* is a mutable pointer to an immutable character/string. You cannot change the contents of the location(s) this pointer points to. Also, compilers are required to give error messages when you try to do so. For the same reason, conversion from const char * to char* is deprecated. | |
char* const is an immutable pointer (it cannot point to any other location) but the contents of location at which it points are mutable. | |
const char* const is an immutable pointer to an immutable character/string. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment