qualifications in prototypes (was Re: Problems with IBM RS6000 C compiler)
Richard Tobin
richard at aiai.ed.ac.uk
Wed Aug 8 22:54:42 AEST 1990
>>[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 at uk.ac.ed
AI Applications Institute, ARPA: R.Tobin%uk.ac.ed at nsfnet-relay.ac.uk
Edinburgh University. UUCP: ...!ukc!ed.ac.uk!R.Tobin
More information about the Comp.lang.c
mailing list