#include #include // another example, in addition to example8.cpp, // of code using pointers of pointers. // This example is not very realistic, but it shows // how pointers of pointers can be manipulated. void foo(char ***** b) { ****b = (char *) malloc(sizeof(char) * 6); (****b)[0] = 'h'; (****b)[1] = 'e'; (****b)[2] = 'l'; (****b)[3] = 'l'; (****b)[4] = 'o'; (****b)[5] = 0; } int main() { char * a = "john"; char ** b = &a; char *** c = &b; char **** d = &c; printf("before calling foo:\n"); printf("a = %s\n\n", a); foo(&d); // note that the value of a // is different after calling the foo function printf("after calling foo:\n"); printf("a = %s\n", a); }