delorie.com/archives/browse.cgi | search |
From: | chris_mears AT softhome DOT net (Chris Mears) |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: How big is a SHORT? |
Organization: | CHOAM |
Message-ID: | <3808932e.7531853@news.bigpond.com> |
References: | <7ua3p7$nlt$2 AT news8 DOT svr DOT pol DOT co DOT uk> |
X-Newsreader: | Forte Agent 1.5/32.452 |
MIME-Version: | 1.0 |
Lines: | 16 |
Date: | Sat, 16 Oct 1999 15:06:23 GMT |
NNTP-Posting-Host: | 139.134.192.163 |
X-Trace: | newsfeeds.bigpond.com 940086155 139.134.192.163 (Sun, 17 Oct 1999 01:02:35 EST) |
NNTP-Posting-Date: | Sun, 17 Oct 1999 01:02:35 EST |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
On Sat, 16 Oct 1999 15:55:35 +0100, "Hammy" <darren AT grayce DOT freeserve DOT co DOT uk> wrote: >so, how many bits is it? >most books say it it the same as an int, but when I make a structures using >int and shorts, they give different results? > > Depends on your implementation. The C standard says it must be at least 16 bits. In DJGPP a short is 16 bits wide. Books that state that an int is *always* the same width as a short are wrong. The standard only gives minimum values; an implementation can have them as big as it wants (within certain restraints).
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |