size of an int

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AmberJain
    Recognized Expert Contributor
    • Jan 2008
    • 922

    #16
    Hello,
    Originally posted by Arepi
    Let me to quote from "Brian W. Kernighan. Dennis M. Ritchie :The C programming language"

    url:<url removed>
    On site 111:
    The reply #12 contains a download link to the book "The C programming language". Now that link might violate the copyrights for the book. Admins/mods ahould consider removing that link.

    Also, I could not find report button for this thread and so I replied in this thread.

    Thanks....
    AmbrNewlearner

    Comment

    • boxfish
      Recognized Expert Contributor
      • Mar 2008
      • 469

      #17
      The report button is the little red and white triangle with the black line in the top right corner.

      Comment

      • axneer
        New Member
        • Jun 2007
        • 8

        #18
        The author of my book is saying
        "on a 16 bit OS like MS-DOS or windows 3.1 an integer occupies 2 bytes,In case of 32 bit Os like windows 95/98/Me/NT the size of int is 4 bytes"

        also he has given a table like

        data type range
        signed char (-128 to 127)
        unsigned char (0 to 255 )
        signed int (-32768 to 32767)
        like so on------

        and said note at the bottom "the sizes and ranges of int,short and long are OS dependent.Sizes in figures are for 16 bit OS"

        is he wrong or partially correct?

        Comment

        • newb16
          Contributor
          • Jul 2008
          • 687

          #19
          Originally posted by axneer
          and said note at the bottom "the sizes and ranges of int,short and long are OS dependent.Sizes in figures are for 16 bit OS"

          is he wrong or partially correct?
          He is correct about ranges for 16- and 8-bit values. But sizes for builtin types are defined by compiler, not OS. If he did not explained it as 'sizes of values accepted by OS API functions' it is wrong - e.g. 32bit program under dos extender under dos.

          Comment

          • Banfa
            Recognized Expert Expert
            • Feb 2006
            • 9067

            #20
            Originally posted by ambrnewlearner
            The reply #12 contains a download link to the book "The C programming language".
            Good catch but by quoting it you doubled the amount of clean-up I had to do :D

            Comment

            • AmberJain
              Recognized Expert Contributor
              • Jan 2008
              • 922

              #21
              Hello,

              Originally posted by boxfish
              The report button is the little red and white triangle with the black line in the top right corner.
              Oh ok...I get it now. ty.

              Originally posted by Banfa
              Good catch but by quoting it you doubled the amount of clean-up I had to do :D
              OOPS..I almost forgot that. ;)

              AmbrNewlearner

              Comment

              Working...