problem with fread/fwrite

Jon H. LaBadie jon at jonlab.UUCP
Fri Nov 16 18:14:41 AEST 1990


Despite all the discussion on this topic, I do not see the need for
the programmer to indicate a switch from reading to writing and visa
versa.  I mean I know it is needed, but I do not understand why.

If in the stdio buffer I have the following;

	Mary had a big sheep.  Supercalifragalisticexpalidocious ...
	^

With my pointer (read in this case) on the 'M', after I fread 23 bytes,
so my buffer and pointer are such:

	Mary had a big sheep.  Supercalifragalisticexpalidocious ...
	                       ^

what is wrong with fwrite'ing "Jack and Jill" on top of Super...?
I.e. what is critical returning to some ground zero state before
making a transition?

Jon

-- 
Jon LaBadie
{att, princeton, bcr, attmail!auxnj}!jonlab!jon



More information about the Comp.lang.c mailing list