Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius) Newsgroups: comp.lang.c Subject: Re: Explanation, someone?? Message-ID: <1991Jun15.132852.17666@klaava.Helsinki.FI> Date: 15 Jun 91 13:28:52 GMT References: <33641@usc.edu> Organization: University of Helsinki Lines: 22 [ I have edited the code for brevity. --liw ] >char *c[] = { "ENTER", "NEW", "POINT", "FIRST" }; >char **cp[] = { c+3, c+2, c+1, c}; >char ***cpp = cp; >main() { > printf("%s", *++cpp); ^- are you certain there isn't a * missing here? The type of *++cpp is char**, which is not what printf expects, but if you insert the asterisk, you get **++cpp with the type char* and the output is POINTERSTEW. > printf("%s", *--*++cpp+3); > printf("%s", *cpp[-2]+3); > printf("%s\n", cpp[-1][-1]+1 ); >} I didn't see anything wrong with the other program, "SWITCH SWAMP \n" is the expected output (note the space before the newline). One way to understand it is to go through it with a pen and some paper and keep trace of each variable at every step. -- Lars Wirzenius wirzeniu@cc.helsinki.fi