www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/13/21:47:18

Xref: news2.mv.net comp.os.msdos.djgpp:4944
From: calvid AT goya DOT its DOT rpi DOT edu (David J. Calvin)
Newsgroups: comp.os.msdos.djgpp
Subject: How are bool's allocated?
Date: 13 Jun 1996 14:20:15 GMT
Organization: Rensselaer Polytechnic Institute, Troy NY, USA
Lines: 11
Message-ID: <4pp82v$qd4@usenet.rpi.edu>
NNTP-Posting-Host: goya.its.rpi.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In DJGPP, how is memory allocated for bool variables?  Is just
1 bit allocated, or a whole byte?  If you do sizeof(bool), it
returns 1, but maybe that's just a limitation of sizeof(). 
I'm planning on using a large number of bool's in a structure,
and I was wondering if it would be more efficient to declare
them all as bool's, or to use unsigned characters and use
bitwise ops to access each bit that way.  Thanks for the info.

Dave Calvin
calvid AT rpi DOT edu

- Raw text -


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