Article View: comp.std.c++
Article #2917Re: Stuff C++ needs
From: Charley Bay (Contract)
Date: Fri, 08 Dec 1995 16:13
Date: Fri, 08 Dec 1995 16:13
29 lines
1935 bytes
1935 bytes
: In article ghm@bcarh8ab.bnr.ca, "brian (b.c.) white" <bcwhite@bnr.ca> writes: : >I thought I read somewhere that C++ guarantees a "char" to be 8 bits (or : >was that "one byte"?). Steve Clamage (clamage@Eng.Sun.COM) responded: : In C and C++, the size of a char or a byte is always implementation-defined, : and neither is required to be exactly 8 bits. A char or a byte could have more : (or fewer) than 8 bits. : [snip, standard reference] Right--remember back to the old C days? A "byte" was defined to be a sizeof() of ONE, and all other data types were based on multiples of ONE. (An "int" was TWO on MS-DOS platforms, or FOUR on UNIX platforms, etc.) The platform determined exactly what that ONE was, and the source code was never supposed to care. This was a major boon for portability (although I acknowledge it's harder to guess ranges). -- --charley #include <stdisclaimer.h> charleyb@gr.hp.com -or- charley@agrostis.nrel.colostate.edu [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<DJ9zGw.B6M@boi.hp.com>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageReferences:
<4a792a$ghm@bcarh8ab.bnr.ca> <4a7do9$itd@engnews1.eng.sun.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: charleyb@gr.hp.com (Charley Bay (Contract)) Newsgroups: comp.std.c++ Subject: Re: Stuff C++ needs Date: 8 Dec 1995 16:13:04 GMT Organization: Hewlett-Packard Co., Greeley, CO, USA Sender: news@hpbs2500.boi.hp.com (Boise Site News Server) Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <DJ9zGw.B6M@boi.hp.com> References: <4a792a$ghm@bcarh8ab.bnr.ca> <4a7do9$itd@engnews1.eng.sun.com> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text X-Nntp-Posting-Host: hume.gr.hp.com X-Newsreader: TIN [version 1.2 PL0.11] Apparently-To: comp-std-c++@uunet.uu.net Content-Length: 994 X-Lines: 25 Originator: clamage@taumet