FREAD

cottrell at nbs-vms.ARPA cottrell at nbs-vms.ARPA
Tue Dec 25 02:41:06 AEST 1984


	fread(ptr,sizeof(*ptr),nitems,stream);

if you want 7 bytes and there are only 4 left, do:
	
	n = fread(buf,1,7,stdin);	/* n will be 4 */

however if you switch the 1 & 7, n will be zero, but 4 bytes will
actually be read. to read integers one might do:

	n = fread(intbuf,2,k,stdin);

however, if the byte count is odd, the last integer will be ignored.
*/



More information about the Comp.unix.wizards mailing list