Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!rpi!leah!bingvaxu!cjoslyn From: cjoslyn@bingvaxu.cc.binghamton.edu (Cliff Joslyn) Newsgroups: comp.lang.c Subject: Koenig on pointers and arrays Message-ID: <2804@bingvaxu.cc.binghamton.edu> Date: 18 Jan 90 01:31:48 GMT Organization: SUNY Binghamton, NY Lines: 29 Under the kind attention of Chris Torek and others, I dutifully understand that arrays are not pointers and pointers are not arrays. I believe that I understand the true relation between array subscripting and pointer arithmetic and arrays passed as arguments converted to pointers, etc. So I turn to Andrew Koenig's great book /C Traps and Pitfalls/ and read on p. 27: "Only two things can be done to an array: determine its size and obtain a pointer to element 0 of the array. *All* other array operations are actually done with pointers, even if they are written with what look like subscripts. That is, every subscript operation is equivalent to a pointer operation, so it is possible to define the behavior of subscripts entirely in terms of the behavior of pointers". I presume this is accurate, and that e.g. passing an array as a parameter or taking its address are considered array operations which are actually done with pointers. In other words, is the first sentence above literally accurate? Thanks. -- O-------------------------------------------------------------------------> | Cliff Joslyn, Cybernetician at Large, cjoslyn@bingvaxu.cc.binghamton.edu | Systems Science, SUNY Binghamton, Binghamton NY 13901, USA V All the world is biscuit shaped. . .