Subj : strange string pointer to strings...? To : borland.public.cpp.borlandcpp From : mujeebrm Date : Wed Sep 28 2005 11:44 pm #include #include #include int main(void) { /* this does not make sense to me that when i keep adding rows and columns of strings to this array of pointers to strings it just keeps going on, any explanation for this ? */ char *s[][5]= { "one","qwer", "two", "rewq", "three", "qwer", "four", "rewq", "five", "qwertttt", " ", " " }; char **sp=0,w[10]; int c; do { gets(w); sp = (char **)s;//why r we supposed to init this pointer to pointer to strings // again and again thru the loop do { if(!stricmp(*sp, w) ){ puts( *(sp+1) );// how this prints the right string in array break; } if(!stricmp(*sp, w) )break; sp+=2; // wat is this }while(*sp); c=getch(); }while(c != 'n'); getch(); return (0); } .