Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.lang.c Subject: Re: total space of a string (was: hardcoded constants) Message-ID: <769@auspex.UUCP> Date: 21 Dec 88 17:57:24 GMT References: <1988Dec8.173158.11839@utzoo.uucp> <846@starfish.Convergent.COM> <9134@smoke.BRL.MIL> <1988Dec13.172306.16195@utzoo.uucp> <5146@bsu-cs.UUCP> <1988Dec15.190331.2986@utzoo.uucp> <33604@think.UUCP> <1827@solo11.cs.vu.nl> <29@rpi.edu> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 13 >"/" is a pointer to a string containing a '/' and a '\0'. "/" is not a pointer to a string; it is the string (i.e. an array of "char") itself. In some, but not all, contexts, the array is converted to a pointer to its first member; "argument of 'sizeof'" is not one of those contexts. (Check your K&R, or your dpANS.) >Therefore it seems to me that sizeof "/" will return the same value as >sizeof( char * ). This is, alas, apparently a mistake made by some C implementors; with any luck, there'll be a conformance-testing suite for the ANS when it comes out, and it will catch errors such as that.