5d2 Subj : Re: strange string pointer to strings...? To : borland.public.cpp.borlandcpp From : mujeebrm Date : Fri Sep 30 2005 12:52 am Hi Sir Thomas, this is original code example which i had modified and posted from the book C++ The Complete Reference,3rd ed. written by Herb Schildt. thanx mujeeb. /* A simple dictionary. */ #include #include #include /* list of words and meanings */ char *dic[][40] = { "atlas", "A volume of maps.", "car", "A motorized vehicle.", "telephone", "A communication device.", "airplane", "A flying machine.", "", "" /* null terminate the list */ }; int main(void) { char word[80], ch; char **p; do { puts("\nEnter word: "); scanf("%s", word); p = (char **)dic; /* find matching word and print its meaning */ do { if(!strcmp(*p, word)) { puts("Meaning:"); puts(*(p+1)); break; } if(!strcmp(*p, word)) break; p = p + 2; /* advance through the list */ } while(*p); if(!*p) puts("Word not in dictionary."); printf("Another? (y/n): "); scanf(" %c%*c", &ch); } while(toupper(ch) != 'N'); return 0; } "Thomas Maeder [TeamB]" wrote in > >> char **sp=0,w[10]; >> int c; > > Having read the above-mentioned textbook chapters, what do these > statements mean? > > Going on doesn't make any sense before you can answer this question. . 0