Path: utzoo!attcan!uunet!mcvax!ukc!reading!minster!alistair From: alistair@minster.york.ac.uk Newsgroups: comp.lang.c Subject: Re: Clarification needed on Pointers/Arrays Message-ID: <604751079.17985@minster.york.ac.uk> Date: 1 Mar 89 10:24:39 GMT References: <1436@etive.ed.ac.uk> Reply-To: alistair@SoftEng.UUCP (alistair) Organization: Department of Computer Science, University of York, England Lines: 17 a is an array of pointers - not chars, in other words: a is a pointer to a pointer *a is a pointer **a is a char so passing it to foo1 and 'pretending' it is a pointer to a char does not work. So, b is not pointing to an array of chars, but an array of pointers, but when the compiler encounters b+i it increments b to the next byte address - somewhere in the middle of a pointer. Also, what you really intended to print out was *(b + i), b + i is an address - which is why you happened to get control codes printed - but incremented by one each time. In foo2 b is an address - the base address of an array of pointers. On your implementation (but see other discussions about sizes of pointers in this topic) a char address is the same size as an array address -