Re: sizeof(int)
From: Jack Klein (jackklein_at_spamcop.net)
Date: 02/28/05
- Next message: David Lindauer: "Re: sizeof(int)"
- Previous message: Marco Kunze: "Copy-Constructor"
- In reply to: Ron Natalie: "Re: sizeof(int)"
- Next in thread: Ron Natalie: "Re: sizeof(int)"
- Reply: Ron Natalie: "Re: sizeof(int)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 27 Feb 2005 22:06:57 -0600
On Sun, 27 Feb 2005 09:53:01 -0500, Ron Natalie <ron@sensor.com> wrote
in comp.lang.c++:
> Shezan Baig wrote:
> > DHOLLINGSWORTH2 wrote:
> >
> >>A char is always 8 bits.
> >
> >
> >
> > Why can't a char be 16 bits?
> >
> It can be, but it is unlikely. Unfortunately one of the
> great defects in C++ is that char has a double role: that
> of the basic character AND that of the smallest addressable
> storage unit. Ideally, bytes and characters should be dissassociated.
Interesting. Just today I was working with an architecture where char
has 16 bits, which is indeed the smallest addressable storage unit.
What possible gain from defining a char as 8 bits when a byte is 16
bits? You can only store one char per byte, unless you use bit fields
or bit-wise operators to merge and separate them.
And there are platforms where char and in fact all the integer types
are 32 bits. Period.
-- Jack Klein Home: http://JK-Technology.Com FAQs for comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html comp.lang.c++ http://www.parashift.com/c++-faq-lite/ alt.comp.lang.learn.c-c++ http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
- Next message: David Lindauer: "Re: sizeof(int)"
- Previous message: Marco Kunze: "Copy-Constructor"
- In reply to: Ron Natalie: "Re: sizeof(int)"
- Next in thread: Ron Natalie: "Re: sizeof(int)"
- Reply: Ron Natalie: "Re: sizeof(int)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|