total space of a string (was: hardcoded constants)

Maarten Litmaath maart at cs.vu.nl
Tue Dec 20 02:54:44 AEST 1988


barmar at 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 at cs.vu.nl, mcvax!botter!maart



More information about the Comp.lang.c mailing list