Path: csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Mon, 17 Oct 2016 15:17:54 -0500 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: C Programming Tutorial on Youtube References: <8be0cdbe-c2f4-42ec-b6a7-e9a154981718@googlegroups.com> Date: Mon, 17 Oct 2016 21:17:54 +0100 Message-ID: <8760oqybkd.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:91tz46hXr8E1hKMp8abS1SVGLdQ= MIME-Version: 1.0 Content-Type: text/plain Lines: 26 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-FKhKXQ5uKBBj7hsHLd8lAjnjkOZAp6U+GOVsawcBUJprsD8hBnDy1Daq5QWIAsTd7Zn2IaIw3O2quZ0!j25kg5/sFGD3YT9Kaozv6mfygaxe2UO+JTIkBbbVhUTK9K2578j3M8i5DVN389CtNv8V X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2651 Xref: csiph.com comp.lang.c:95015 Ian Collins writes: > On 10/18/16 01:27 AM, Malcolm McLean wrote: >> 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. > > It's something you get to see very often in "real code". Traversing a > buffer is a far from uncommon activity. It'd be odd to do so with an immutable pointer though. You may as well use buffer directly, if you're not going to use the *ptr++ idiom.