🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2443

Re: const pointer confusion...

#2443
From: Jerry Coffin
Date: Sun, 31 Mar 1996 16:44
24 lines
1403 bytes
In article <4je1pf$g2a@solutions.solon.com>, <aril@cmt.lpr.mail.carel.fi> 
says...
[ my mostly incorrect comment elided ... ] 

> Isn't that what he said?

Yes, it is.  Someday when I learn to read, I might get my posts closer to 
correct...

> FWIW, I've found it intuitive to read the syntax from right 
> to left:
> 
> 	const int *p; = pointer to integer constant
> 	int const *p; = pointer to constant integer (same as above)
> 	int *const p; = constant pointer to integer
> 	const int *const p; = constant pointer to integer constant
> 	int const *const p; = constant pointer to constant integer (same as 
above)

Yup - it's generally expressed as simply the "right to left rule", though in 
many cases it's more the inside to outside rule.  (e.g. in typedef's, you 
generally start around the middle and work your way outward...)
    Later,
    Jerry.
Technical Details
Message-ID: <4jmcp7$lsp@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4j06gm$7oa@solutions.solon.com><4j633s$3e7@solutions.solon.com><4je1pf$g2a@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: jcoffin@rmii.com (Jerry Coffin)
Newsgroups: comp.lang.c.moderated
Subject: Re: const pointer confusion...
Date: 31 Mar 1996 10:44:23 -0600
Organization: TAEUS
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4jmcp7$lsp@solutions.solon.com>
References: <4j06gm$7oa@solutions.solon.com><4j633s$3e7@solutions.solon.com><4je1pf$g2a@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com
X-Newsreader: MicroPlanet News32 v1.00 Beta Build 302