write(fd,"foobar",sizeof("foobar"))

Wayne Throop throopw at sheol.UUCP
Sun Sep 23 08:28:02 AEST 1990


> From: jdarcy at encore.com (Jeff d'Arcy)
>	static char message[] = "hello";
>	/* ... */
>	write(fd,message,sizeof(message));

Note that (sizeof(message)) is 6... the suggested "write" will
solve the question on that other thread... how to write a NUL to a file.

( Also note that the form as it appears in the Subject: line has
  been known to break pcc-based compilers if I remember right... they
  were promoting "foobar" to a pointer "too soon". Getting Jeff's verseion
  wrong seems much, much rarer. )
--
Wayne Throop <backbone>!mcnc!rti!sheol!throopw or sheol!throopw at rti.rti.org



More information about the Comp.lang.c mailing list