Path: 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: 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 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!"