Re: short int always 16 bits or not?

Discussion in 'C Programming' started by Lynn McGuire, Apr 20, 2013.

  1. Lynn McGuire

    Lynn McGuire Guest

    On 4/19/2013 7:14 PM, Shriramana Sharma wrote:
    > Hello. I am reading the C99 standard as available from: http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf
    >
    > I note that it specifies (on p 34) macros defining the minimum and maximum values of a short int corresponding to a size of 16 bits. However it doesn't explicitly say that short int-s should be of 16 bits size. So can I trust short int-s to be 16 bits size or not?
    >
    > Also, doesn't prescribing #define-s for integer type min/max values conflict with the general (?) understanding that the size of these types are implementation defined? I mean, is the general understanding wrong? (For instance see: http://en.wikipedia.org/wiki/Short_integer#cnote_b_grp_notesc)
    >
    > Finally, why would anyone want char to be other than 8 bits? *Is* char on any platform *not* 8 bits?
    >
    > Thanks.


    The first computer that I wrote code on was a Univac
    1108. Chars were only six bits and ASCII. So, there
    was no lower case characters (lower case is the 7th bit).

    Lynn
    Lynn McGuire, Apr 20, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Barry Schwarz

    Re: short int always 16 bits or not?

    Barry Schwarz, Apr 20, 2013, in forum: C Programming
    Replies:
    2
    Views:
    192
    glen herrmannsfeldt
    Apr 22, 2013
  2. Eric Sosman

    Re: short int always 16 bits or not?

    Eric Sosman, Apr 20, 2013, in forum: C Programming
    Replies:
    0
    Views:
    193
    Eric Sosman
    Apr 20, 2013
  3. Shriramana Sharma

    Re: short int always 16 bits or not?

    Shriramana Sharma, Apr 20, 2013, in forum: C Programming
    Replies:
    10
    Views:
    301
    Ken Brody
    Apr 25, 2013
  4. James Kuyper

    Re: short int always 16 bits or not?

    James Kuyper, Apr 20, 2013, in forum: C Programming
    Replies:
    2
    Views:
    176
    James Kuyper
    Apr 22, 2013
  5. Les Cargill

    Re: short int always 16 bits or not?

    Les Cargill, Apr 20, 2013, in forum: C Programming
    Replies:
    0
    Views:
    177
    Les Cargill
    Apr 20, 2013
Loading...

Share This Page