delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/30/21:13:36

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: File reading
Date: Fri, 30 Jan 1998 19:14:12 +0000
Organization: None
Distribution: world
Message-ID: <I3YxpJAEai00Ewq4@talula.demon.co.uk>
References: <34CC6531 DOT A6869055 AT mail DOT htk DOT fi>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 22
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Henri Ossi writes:
>How can I
>
>1)read 8bits from a file

Call fgetc().

>2)write 8bits to a file

Call fputc().

>Char is 16bit long, right?

What gave you this idea? Using djgpp, as with most 32 bit compilers, a
char is 8 bits, a short is 16 bits, and an int or long is 32 bits.
Although it is perfectly legal according to the ANSI standard, compilers
with anything other than an 8 bit character type are very unusual...


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019