fread, yet again

cottrell at nbs-vms.ARPA cottrell at nbs-vms.ARPA
Thu Dec 27 01:38:51 AEST 1984


/*
i wish our 4.2bsd vax was connected to arpa instead of vms...
here is the output of a program i ran
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
n = 180
buf = -----
/* z.c */
#include <stdio.h>
main()
{	char buf[999]; int n; FILE *f;
	f = fopen("z.c","r");
	n = fread(buf,1,998,f);
	printf("n = %d\nbuf = -----\n%s\n-----\n",n,buf);
}
/* z.c */

-----
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
i could have formatted it a bit better, but it shows that fread works
the way it claims to. it is useful too.
*/



More information about the Comp.unix.wizards mailing list