From the standard:
const char c="c";
char* pc;
const char** pcc = &pc; // not allowed
*pcc = &c;
*pc="C"; // would allow to modify a const object
More Related Contents:
- Does const-correctness give the compiler more room for optimization?
- What is the difference between const int*, const int * const, and int const *?
- Why can’t I convert ‘char**’ to a ‘const char* const*’ in C?
- Modifying a const through a non-const pointer
- C++ typedef interpretation of const pointers
- Modifying a const int in C++ [duplicate]
- Pointer to array with const qualifier in C & C++
- C++: Why is const_cast evil?
- Returning non-const reference from a const member function
- Const variable changed with pointer in C
- Use const wherever possible in C++?
- non-const pointer argument to a const double pointer parameter
- How to assign string pointer value to elements of a vector using loops in C++
- Something went wrong with passing pointer to a function
- How to convert a std::string to const char* or char*
- Determine the size of a C++ array programmatically?
- Difference Between *(Pointer + Index) and Pointer[]
- What is the purpose of allocating a specific amount of memory for arrays in C++?
- C++: Is it safe to cast pointer to int and later back to pointer again?
- Const and Non-Const Operator Overloading
- Casting between void * and a pointer to member function
- What are the operations supported by raw pointer and function pointer in C/C++?
- Difference between passing array, fixed-sized array and base address of array as a function parameter
- gsl::not_null vs. std::reference_wrapper vs. T&
- Copying derived entities using only base class pointers, (without exhaustive testing!) – C++
- Function stoi not declared
- Modifying reference member from const member function in C++
- prolonging the lifetime of temporaries
- What does ‘return *this’ mean in C++?
- Meaning of *& and **& in C++