Hi

Here is an excerpt from the C++ standard about the size of fundamental types 
(clause 5.3.3) :

sizeof(char), sizeof(signed char) and sizeof(unsigned char) are 1; the  result 
of sizeof applied to any other fundamental type (3.9.1) is 
implementation-defined. [Note: in particular, sizeof(bool) and 
sizeof(wchar_t) are implementation-defined.69) ] 


Regards

Patrick

Le jeudi 24 juin 2010, Stephan Bergmann a écrit :
> On 06/24/10 14:24, Rene Engelhard wrote:
> > On Thu, Jun 24, 2010 at 02:15:29PM +0200, Michael Stahl wrote:
> >> isn't bool ususally (or at least sometimes) 4 bytes in size?
> >
> > $ cat test.cxx
> > #include <stdio.h>
> >
> > int main() {
> >     printf("%d\n", sizeof(bool));
> > }
> > $ g++ -o lala ./test.cxx
> > $ ./lala
> > 1
>
> sizeof(bool) is implementation-defined, but typically 1.
>
> -Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to