Q about statement in Shtern's Core C++ A Software Engineering Approach

From: Ward (learning987_at_yahoo.com)
Date: 03/10/04

  • Next message: Jason Spashett: "Re: [C] Array bounds in function prototypes"
    Date: 10 Mar 2004 12:03:05 -0800
    
    

    I'm confused by the following from Victor Shtern's book Core C++: A
    Software Engineering Approach. In Chapter 3, Integral Types, Integer
    Type Qualifiers, this excerpt is confusing me:

    <quote>
    For any platform, the following relation between returned values of
    the sizeof operator holds.

         sizeof(short int) <= sizeof(int) <= sizeof(long int)

    There is an interesting consequence of this design: shortint and
    longint are always of the same size no matter whether the machine is
    16 bits or 32 bits. On any architecture, shortint is always 16 bits,
    and longint is always 32 bits.
    </quote>

    It seems that the last two sentences from above are contradictory.
    How can that shortint and longint always be the same size and always
    be 16 and 32 bits, respectively?

    Thanks.


  • Next message: Jason Spashett: "Re: [C] Array bounds in function prototypes"