Path: utzoo!attcan!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.lang.c Subject: const applied to typedef'd pointer + const functions Message-ID: <2117@solo11.cs.vu.nl> Date: 2 Mar 89 20:44:03 GMT References: <9078@elsie.UUCP> <9709@smoke.BRL.MIL> <2105@solo11.cs.vu.nl> <11917@haddock.ima.isc.com> Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 16 karl@haddock.ima.isc.com (Karl Heuer) writes: \After `typedef char *string', \`string const x' means `char * const x' rather than `char const * x'. Of course. But I was talking of `const string x'; in my opinion this should mean `const char *x'. ADO's example `const string const x' should translate to `const char * const x'. I guess the problem is the equivalence of `const char' and `char const', which - generalized - leads to `const string' == `string const'. This equivalence is dubious, or? BTW, how about letting `const double sin(double)' mean "sin() is a `true' function"? (`true': same args -> same result [i.e. no side-effects]) -- "Those who do not understand Henry |Maarten Litmaath @ VU Amsterdam: Spencer are condemned to reinvent DOS." |maart@cs.vu.nl, mcvax!botter!maart