Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!sdcrdcf!hplabs!hao!seismo!brl-tgr!tgr!cottrell@nbs-vms.ARPA From: cottrell@nbs-vms.ARPA Newsgroups: net.unix-wizards Subject: FREAD Message-ID: <6756@brl-tgr.ARPA> Date: Mon, 24-Dec-84 11:41:06 EST Article-I.D.: brl-tgr.6756 Posted: Mon Dec 24 11:41:06 1984 Date-Received: Thu, 27-Dec-84 02:49:01 EST Sender: news@brl-tgr.ARPA Organization: Ballistic Research Lab Lines: 14 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. */