Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: usecases of void foo(char **b) {} Date: Tue, 01 Nov 2016 08:25:15 -0700 Organization: None to speak of Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="3c9491fcd50349ea336243ee8772beaa"; logging-data="20139"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188keGCT7UycBH3oLX7yesv" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:VN+mIAmC/P8pWDZmcgIueQg61Nw= sha1:Sci9BGGqwliRUF5GhNh1gMW9uds= Xref: csiph.com comp.lang.c:95514 Keith Thompson writes: [...] > A (valid non-null) pointer is always a pointer to a single object. That > single object may or may not be the initial element of an array object. [...] Sorry, I missed a couple of cases. A valid pointer can point just past the last element of an array object, and a non-null pointer of pointer-to-function type can point to a function. And for purposes of pointer arithmetic, a single object is treated as a element of a single-element array. So, for example, this sets p to a valid pointer value (which cannot be derferenced): int n; int *p = &n + 1; -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"