fwrite(buf, 0, 42, stream) == ?

Doug Gwyn gwyn at smoke.BRL.MIL
Wed Jun 13 14:12:00 AEST 1990


In article <Fkucoph at cs.psu.edu> flee at psuvax1.cs.psu.edu (Felix Lee) writes:
>What is fwrite(buf, 0, 42, stream) supposed to return?  I feel it
>should return 42 when it successfully writes 42 objects of zero size,
>but existing implementations seem to return 0.

Strictly speaking, there are no semantics defined for such usage,
because the "0" is supposed to be the size of some member of an
array, and there are no 0-sized objects in C.



More information about the Comp.std.c mailing list