#include #include using namespace std; //T must be puttable (printable with <<) in the following templates. template inline void print(const T& t) {cout << t;} template void print(const T *p) { cout << p; if (p != 0) { cout << " -> "; print(*p); //call line 11 if *p is a pointer, line 8 otherwise } } int main() { int i = 10; print(i); cout << "\n"; const int *p = &i; print(p); cout << "\n"; const int *const *pp = &p; print(pp); cout << "\n"; const int *const *const *ppp = &pp; print(ppp); cout << "\n"; return EXIT_SUCCESS; }