sizeof "string"

chris at umcp-cs.UUCP chris at umcp-cs.UUCP
Fri Feb 3 08:11:00 AEST 1984


"Hello\0, world" is one string.  If I say

	write (1, "Hello\0, world", 13);

I expect 13 characters to be written, with NUL and all.

(One might actually have a reason to depend on this -- say you were
storing ``very small'' integers in a char array.  You could use:

	char permute[] = "\2\1\0\9\8\7\6\3\4\5";

to get a weird permutation table.)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris.umcp-cs at CSNet-Relay



More information about the Comp.lang.c mailing list