hardcoded constants

Richard A. O'Keefe ok at quintus.uucp
Sat Dec 17 10:46:29 AEST 1988


henry at utzoo.uucp (Henry Spencer) writes:
>-	foo = malloc(strlen(a)+strlen(b)+2);	/* 2 for '/' '\0' */
>-Now, what's a good name for that "2", and how does naming it improve
>-readability?

I recently had a very similar problem.  A *superb* "name" for that 2 is
		sizeof "/"



More information about the Comp.lang.c mailing list