Re: sizeof(int)

From: David Lindauer (camille_at_bluegrass.net)
Date: 02/28/05


Date: Mon, 28 Feb 2005 04:07:20 GMT


Victor Bazarov wrote:

> "DHOLLINGSWORTH2" <DHOLLINGSWORTH2@cox.net> wrote...
> >
> > "Ron Natalie" <ron@sensor.com> wrote in message
> > news:4221de94$0$28724$9a6e19ea@news.newshosting.com...
> >> 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.
> >
> > You are correct, I should have said "Byte".
>
> In C++ terms 'char' and 'byte' are interchangeable. You should have
> said "octet", maybe.
>

on *most* processors this is true. As I mentioned some processors cannot
access data in byte-sized chunks. That is why the standard describes the
relationship of the various integral types in relative terms rather than
giving specific sizes.