Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!cornell!batcomputer!itsgw!rpi!rpics!kyriazis From: kyriazis@rpics (George Kyriazis) Newsgroups: comp.lang.c Subject: Re: total space of a string (was: hardcoded constants) Message-ID: <29@rpi.edu> Date: 21 Dec 88 05:31:42 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> Sender: usenet@rpi.edu Reply-To: kyriazis@turing.cs.rpi.edu (George Kyriazis) Organization: RPI CS Dept. Lines: 19 In article <1827@solo11.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: >barmar@think.COM (Barry Margolin) writes: >\1) When I've done this in other languages, I've used something like >\strlen("/") instead of the 2. Unfortunately, in C I'd still have to >\say "+1", .... > >How about the following? > > sizeof "/" "/" is a pointer to a string containing a '/' and a '\0'. Therefore it seems to me that sizeof "/" will return the same value as sizeof( char * ). Comments?? George Kyriazis kyriazis@turing.cs.rpi.edu kyriazis@ss0.cicg.rpi.edu ------------------------------