#include #include main() { int i,j,m; /* Declare the double pointer */ char **cpp; /* Allocate the memory, 4 times the size of a char pointer */ cpp = (char**) malloc(4*sizeof(char *)); /* Allocate the memory, for each char pointer */ *(cpp + 0) = (char *) malloc(12); *(cpp + 1) = (char *) malloc(16); *(cpp + 2) = (char *) malloc(4); *(cpp + 3) = (char *) malloc(8); /* Copy each string in to the Allocated space */ strcpy( *(cpp+0), "hello to"); strcpy( *(cpp+1), "my_server"); strcpy( *(cpp+2), "-p"); strcpy( *(cpp+3), "1000"); for(i = 0; i < 4; i++) { m = strlen( *(cpp + i)); printf("Print the entire string\n"); printf("%s\n", *(cpp + i)); printf("Print out each character of the string\n"); for(j = 0; j < m; j++) { printf("%d %c\n", *(*(cpp + i) + j), *(*(cpp + i) + j)); } } }