🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #378

Re: 'const' revisited

#378
From: David S. Masterson
Date: Mon, 20 Aug 1990 07:37
21 lines
1345 bytes
In article <2648@dataio.Data-IO.COM> bright@Data-IO.COM (Walter Bright) writes:

   As a case in point, let's try to implement an ANSI C memchr:

	   void *memchr(const void *p,int c,size_t n)
	   {	while (n--)
		   {	if (*(const char *)p == c)
				   return (void *) p;	/* !!! */
			   p++;
		   }
		   return NULL;
	   }

Hmmm.  I take it back, this does look like a problem with a constant 'const'.
I'll have to think about this.
--
====================================================================
David Masterson					Consilium, Inc.
uunet!cimshop!davidm				Mtn. View, CA  94043
====================================================================
"If someone thinks they know what I said, then I didn't say it!"
Technical Details
Message-ID: <CIMSHOP!DAVIDM.90Aug20003705@uunet.UU.NET>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!uunet!cimshop!davidm
References: <56514@microsoft.UUCP> <1990Aug14.125734.28015@cbnewsm.att.com> <56586@microsoft.UUCP> <2648@dataio.Data-IO.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!uunet!cimshop!davidm
From: cimshop!davidm@uunet.UU.NET (David S. Masterson)
Newsgroups: comp.std.c++
Subject: Re: 'const' revisited
Message-ID: <CIMSHOP!DAVIDM.90Aug20003705@uunet.UU.NET>
Date: 20 Aug 90 07:37:05 GMT
References: <56514@microsoft.UUCP> <1990Aug14.125734.28015@cbnewsm.att.com>
 <56586@microsoft.UUCP> <2648@dataio.Data-IO.COM>
Sender: davidm@cimshop.UUCP
Distribution: usa
Organization: Consilium Inc., Mountain View, California.
Lines: 21
In-reply-to: bright@Data-IO.COM's message of 15 Aug 90 23:27:23 GMT