Path: utzoo!attcan!uunet!mcsun!ukc!edcastle!aiai!richard From: richard@aiai.ed.ac.uk (Richard Tobin) Newsgroups: comp.lang.c Subject: Re: qualifications in prototypes (was Re: Problems with IBM RS6000 C compiler) Message-ID: <3157@skye.ed.ac.uk> Date: 8 Aug 90 12:54:42 GMT References: <476@mtndew.UUCP> <1893@tkou02.enet.dec.com> <386@taumet.com> <17240@haddock.ima.isc.com> <1896@tkou02.enet.dec.com> <17247@haddock.ima.isc.com> Reply-To: richard@aiai.UUCP (Richard Tobin) Organization: AIAI, University of Edinburgh, Scotland Lines: 14 >>[Can you pass an unqualified `char *' to a function whose prototype declares >>a parameter of type `char const *'?] The idea (presumably) is that declaring a parameter `char const *' doesn't mean that the function *requires* the argument to be constant, but rather promises not to change it. Similarly with assignement; you can assign something to a variable that promises to be more careful with it, but need a cast if the variable might be less careful. -- Richard -- Richard Tobin, JANET: R.Tobin@uk.ac.ed AI Applications Institute, ARPA: R.Tobin%uk.ac.ed@nsfnet-relay.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!R.Tobin