Re: Integer sizes
From: Dan W. (danw_at_raytron-controls.com)
Date: 12/04/03
- Next message: Eternally: "Re: How do you know datatype when using Templates?"
- Previous message: Jumbo: "Re: I'm a stupid blond :( Please help me!!!"
- In reply to: David Fisher: "Integer sizes"
- Next in thread: Peter van Merkerk: "Re: Integer sizes"
- Reply: Peter van Merkerk: "Re: Integer sizes"
- Reply: Rolf Magnus: "Re: Integer sizes"
- Reply: Jack Klein: "Re: Integer sizes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 04 Dec 2003 01:23:36 -0500
On Thu, 4 Dec 2003 16:10:07 +1100, "David Fisher"
<nospam@nospam.nospam.nospam> wrote:
>The most common sizes of integer types seem to be:
>
>8 bits - signed char
>16 bits - short
>16 or 32 bits - int
>32 or 64 bits - long
>
>Question #1:
>
>Does anyone know how common sizes other than these are ? I know that the
>standard says that number of bits in a "byte" (char) is >= 8, but I have not
>come across values other than these yet ...
>
>Question #2:
>
>Is anyone aware of a package that has some portable definitions of things
>like Int8, Int16 and Int32 (assuming they are possible for the platform) ?
>If not, I think you could do this using the definitions in <limits.h>
>(<climits> ?). I am aware that the preprocessor doesn't understand the
>sizeof operator, so you can't do it that way.
I work with a C compiler for which, by default, int is 8 bits.
Personally, I HATE all this business of int, long, long long, double,
double double, and all this incomprehensible crap. *And Non-Portable
Crap, I might add*. Most compilers come with headers, I believe,
where they define numeric types more inteligently, like
__INT08
__INT16
...
__UINT08
__UINT16
and so on. I haven't used them myself, possibly because of the extra
typing (keyboard typing I mean), and to play along with existing code.
There must be, though I can't tell you for sure, standard conforming
and comprehensible numeric types.
I sure hope something is done about this, and real soon, to help us
rid ourselves of "int" and all that.
Yours.
dan
- Next message: Eternally: "Re: How do you know datatype when using Templates?"
- Previous message: Jumbo: "Re: I'm a stupid blond :( Please help me!!!"
- In reply to: David Fisher: "Integer sizes"
- Next in thread: Peter van Merkerk: "Re: Integer sizes"
- Reply: Peter van Merkerk: "Re: Integer sizes"
- Reply: Rolf Magnus: "Re: Integer sizes"
- Reply: Jack Klein: "Re: Integer sizes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|