TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Pascal.Schmidt!1.153.401.2{at}filegate
from: Jerry Coffin
date: 2004-01-20 14:31:38
subject: Re: [C] (Thanks)An interesting question

From: Jerry Coffin 

At 02:26 PM 1/19/2004, you wrote:
>Hi Roy! :-)
>
>  RJT> Not necessarily ASCII,  but whatever "char" is
that's native to the
>  RJT> platform you're running on.  If it was EBCDIC,  then they're 8-bit
>  RJT> characters.
>I don't think there is any C compiler where a char has more or less than 8
>bits.

There are compilers, especially on DSPs, where char is 16 bits.  The reason
is pretty simple: some DSPs aren't really built to deal with anything
smaller than that.

>Note that the size of a long changes depending on the target CPU (at least in
>gcc) - for 32 bit archs, a long is 32 bits (and an int as well). For 64 bit
>archs, long is 64 bits and int is 32 bits.

The sizes of nearly all types are open to variation.  You probably see int
vary the most, but but char int and long all vary quite routinely.  For
whatever reason, the most dependable one is probably short being 16 bits.

In C99, they've added a number of new typedefs for int16_t, int32_t, and so on.
         Later,
         Jerry.

--- BBBS/LiI v4.01 Flag-5
* Origin: Prism's_Point (1:261/38.1)
SEEN-BY: 633/267 270
@PATH: 261/38 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.