delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/05/29/12:30:09

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Declaring byte
Date: 29 May 2002 16:24:05 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 20
Message-ID: <ad2vb5$jgn$1@nets3.rz.RWTH-Aachen.DE>
References: <000501c2071e$d9a72b60$2a08a992 AT hyn>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1022689445 19991 137.226.32.75 (29 May 2002 16:24:05 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 29 May 2002 16:24:05 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Simon <hyn99 AT doc DOT ic DOT ac DOT uk> wrote:
> I am a new user of djgpp, I wonder whether I can declare a variable in
> the form of byte.  

Of course you can.  You can even call it a "byte" if you like:

	typedef unsigned char byte;

	byte a;

All C compilers for "usual" machines (PCs, Apples, whatever) have 8
bits in their builtin type "unsigned char".  The C standard doesn't
enforce this, though, so programs making this assumptions are no
longer fully portable.

OTOH, no code using inline assembly can ever be portable, anyway, so
that's not one of your problems...
-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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