Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Keith Thompson <kst-u@mib.org> |
| Newsgroups | comp.lang.c |
| Subject | Re: extern array as a pointer |
| Date | Tue, 12 Jul 2016 09:26:28 -0700 |
| Organization | None to speak of |
| Lines | 26 |
| Message-ID | <lnk2gqj00b.fsf@kst-u.example.com> (permalink) |
| References | <27db6ff2-216f-41c6-a9e0-c06d206f5262@googlegroups.com> <pan.2016.07.12.12.26.36.123000@nowhere.invalid> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Info | mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="10518"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OPMXO0KhhBzDXjOatdIvi" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
| Cancel-Lock | sha1:YI0IOzogIxWeIIkEhzGgHyldwkU= sha1:f5YR/3m7n/UtTs7+NF8k/YY2gBQ= |
| Xref | csiph.com comp.lang.c:90280 |
Show key headers only | View raw
Nobody <nobody@nowhere.invalid> writes:
[...]
> And, no, it won't work. Arrays aren't pointers.
Right.
> They *decay* to pointers
> when used as expressions (as opposed to lvalues), but they aren't pointers.
lvalues are expressions -- and that's not the right distinction anyway.
(An lvalue is, somewhat loosely, an expression that designates an
object.)
An expression of array type is implicitly converted to a pointer to the
array's initial element *unless* it is one of:
- The operand of a unary "&" operator; or
- The operand of a unary "sizeof" operator; or
- A string literal in an initializer used to initialize an array object.
[...]
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
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"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
extern array as a pointer sinbad <sinbad.sinbad@gmail.com> - 2016-07-12 03:06 -0700
Re: extern array as a pointer BartC <bc@freeuk.com> - 2016-07-12 11:45 +0100
Re: extern array as a pointer Frank Tetzel <s1445051@mail.zih.tu-dresden.de> - 2016-07-12 13:58 +0200
Re: extern array as a pointer Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-12 13:33 +0100
Re: extern array as a pointer Keith Thompson <kst-u@mib.org> - 2016-07-12 09:30 -0700
Re: extern array as a pointer James Kuyper <jameskuyper@verizon.net> - 2016-07-12 12:52 -0400
Re: extern array as a pointer Keith Thompson <kst-u@mib.org> - 2016-07-12 11:30 -0700
Re: extern array as a pointer supercat@casperkitty.com - 2016-07-12 11:51 -0700
Re: extern array as a pointer supercat@casperkitty.com - 2016-07-12 10:55 -0700
Re: extern array as a pointer Keith Thompson <kst-u@mib.org> - 2016-07-12 09:28 -0700
Re: extern array as a pointer Nobody <nobody@nowhere.invalid> - 2016-07-12 13:26 +0100
Re: extern array as a pointer Keith Thompson <kst-u@mib.org> - 2016-07-12 09:26 -0700
Re: extern array as a pointer Richard Heathfield <rjh@cpax.org.uk> - 2016-07-12 13:46 +0100
Re: extern array as a pointer James Kuyper <jameskuyper@verizon.net> - 2016-07-12 12:33 -0400
csiph-web