🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4833

Re: sizeof(char) ~= sizeof(float)

#4833
From: Stephen Baynes
Date: Tue, 27 Feb 1996 13:09
21 lines
1707 bytes
Tanmoy Bhattacharya (tanmoy@qcd.lanl.gov) wrote:
: In article <4gr3d1$dca@usenet.pa.dec.com>
: diamond@tbj.dec.com (Norman Diamond) writes:
<snip - copying data by using chars of different sorts vs memcpy >
: This was a free-standing implementation, and memcpy may be absent. (In
: a hosted implementation, as all read/write is done as if through
: getc/putc which handles unsigned char values, and binary files written
: out must be read back unchanged, the situation is impossible).

That read/write is done by getc/putc does not imply very much about copying
chars. I don't see any requirement that fwrite/fread use one putc/getc per
byte(ie char) of memory. Fwrite could use one per bit writing the values 'Y' or
'N' if it wanted so long as fread will read it back again. My understanding
is that the use of getc/putc means you can write a file with fwrite, copy it
with getc/putc and read the copy with fread to get what you started with.

--
Stephen Baynes                              baynes@ukpsshp1.serigate.philips.nl
Philips Semiconductors Ltd
Southampton                                 My views are my own.
United Kingdom
Technical Details
Message-ID: <DnFr78.1wo@ukpsshp1.serigate.philips.nl>
Path: arc1-ca.pugleaf.net!phcoms4.seri.philips.nl!panther!baynes
References: <WALD.96Feb24131532@woodpecker.lcs.mit.edu> <4gr3d1$dca@usenet.pa.dec.com> <TANMOY.96Feb25203514@qcd.lanl.gov>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!phcoms4.seri.philips.nl!panther!baynes
From: baynes@ukpsshp1.serigate.philips.nl (Stephen Baynes)
Subject: Re: sizeof(char) ~= sizeof(float)
Sender: news@ukpsshp1.serigate.philips.nl (account for localnews)
Message-ID: <DnFr78.1wo@ukpsshp1.serigate.philips.nl>
Date: Tue, 27 Feb 1996 13:09:08 GMT
References: <WALD.96Feb24131532@woodpecker.lcs.mit.edu> <4gr3d1$dca@usenet.pa.dec.com> <TANMOY.96Feb25203514@qcd.lanl.gov>
Organization: Philips Semiconductors, Southampton, UK
X-Newsreader: TIN [version 1.2 PL2]