/* More pointer details A pointer to pointer pointer to const, const pointer const pointer to const */ #include #include using namespace std; void funk(const int* p); int main() { int i = 34; int j = 22; int* pi = &i; *pi = 35; cout << *pi << endl; int** ppi = π **ppi = 36; cout << i << endl; const int* pc = &i; // pointer to const (a pointer to const is not a const variable) pc = &j; funk(&i); int * const cp = &i; // const pointer (it is a const variable) *cp = 38; cout << i << endl; // cp = &j; // ERROR const int* const cpc = &i; // const pointer to oonst } void funk(const int* p) { //*p = 99; // ERROR }