Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!unmvax!ncar!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.lang.c Subject: total space of a string (was: hardcoded constants) Message-ID: <1827@solo11.cs.vu.nl> Date: 19 Dec 88 16:54:44 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> Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 13 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", which I'd then want to comment with /* leave room for the \trailing null */, since I don't think there's an expression that will \return the total space taken up by a string. How about the following? sizeof "/" -- fcntl(fd, F_SETFL, FNDELAY): |Maarten Litmaath @ VU Amsterdam: let's go weepin' in the corner! |maart@cs.vu.nl, mcvax!botter!maart