Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!jrdzzz.jrd.dec.com!tkou02.enet.dec.com!jit533!diamond From: diamond@jit533.swstokyo.dec.com (Norman Diamond) Newsgroups: comp.std.c Subject: Re: const char* Message-ID: <1991May13.004427.26527@tkou02.enet.dec.com> Date: 13 May 91 00:44:27 GMT References: <4278@rwthinf.UUCP> <16061@smoke.brl.mil> <1742@targon.UUCP> Sender: usenet@tkou02.enet.dec.com (USENET News System) Reply-To: diamond@jit533.enet@tkou02.enet.dec.com (Norman Diamond) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 13 In article <1742@targon.UUCP> andre@targon.UUCP (Andre van Dalen) writes: >Does this mean that you can transform a const char * by calling a function? >char * un_const (const char *p) { return (char *)p; } >const char *read_only; >char *foo = un_const(read_only); Sure, but why bother coding a function? You can just say: char *foo = (char *) read_only; -- Norman Diamond diamond@tkov50.enet.dec.com If this were the company's opinion, I wouldn't be allowed to post it. Permission is granted to feel this signature, but not to look at it.