Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!nrl-cmf!cmcl2!adm!smoke!gwyn From: gwyn@smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Double inderection question Message-ID: <8302@smoke.ARPA> Date: 3 Aug 88 04:40:59 GMT References: <2001@tulum.cs.swarthmore.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 21 In article <2001@tulum.cs.swarthmore.edu> pomeranz@cs.swarthmore.edu (Hal Pomeranz) writes: >char array[10], **ptr; > ptr = &array; >From my limited understanding 'array' is a pointer to the first element >(i.e. a pointer to array[0]), so &array should be a pointer to the pointer. NO. "array" is the name of the array. In MOST expression contexts (but not all) it is converted to a pointer to the first member of the array before it is used. "&array" should give you a pointer to the array (not to its first element), but many older compilers treat it the same as an unadorned "array". >char array[10], **ptr, *bogus_ptr; > bogus_ptr = array; > ptr = &bogus_ptr; "bogus_ptr" IS a pointer to char; in the context of the first assignment, "array" is converted to a pointer to array[0] before being copied into "bogus_ptr". "ptr" is a pointer to "bogus_ptr" and only has anything to do with "array" by virtue of the fact that you made "bogus_ptr" have something to do with "array".