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: C Programming Tutorial on Youtube Date: Mon, 17 Oct 2016 08:41:40 -0700 Organization: None to speak of Lines: 32 Message-ID: References: <8be0cdbe-c2f4-42ec-b6a7-e9a154981718@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="5cf263897792072a9f2f11bacfc4852d"; logging-data="2486"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SJrbTwQciNxWhXcRG/1sV" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:wSWB7MLflsjV9pD2LJm0DOVjcu0= sha1:14fr2VrEHQruM037y3M3XXWwqHM= Xref: csiph.com comp.lang.c:94993 Malcolm McLean writes: > On Saturday, October 15, 2016 at 3:09:38 AM UTC+1, Richard Damon wrote: >> On 10/11/16 9:55 PM, Keith Thompson wrote: >> IF you want a constant pointer to a 'buffer' of ints: >> >> int buffer[1024][ >> >> int * const pointer = buffer; >> >> >> pointer now IS a constant pointer to the array buffer. accessable int by >> int. >> > Yes, but you almost never need to do that. It's not something you are > likely to see in any real code. The reason is that the identifier > "buffer" is an alias for the identifier "pointer", to all intents and > purposes, minus a few quirks which hardly matter and are glitches or > infelicities in the C language anyway. No, "buffer" is the name of an array object, and "pointer" is the name of a pointer object. The behavior of the expressions `sizeof buffer` and `&buffer` are not "quirks which hardly matter". They are the result of rules that are fundamental to a correct understanding of how arrays and pointers work in C. Please stop this nonsense.. -- 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"