public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* long_int vs int byte sizes
@ 2014-04-06  6:05 Joseph Maxwell
  2014-04-06  6:36 ` sisyphus1
  0 siblings, 1 reply; 10+ messages in thread
From: Joseph Maxwell @ 2014-04-06  6:05 UTC (permalink / raw)
  To: cygwin

Not sure if this is hardware, software or compiler dependent


$ uname -a
CYGWIN_NT-5.1 machinename 1.7.28(0.271/5/3) 2014-02-09 21:06 i686 Cygwin

On a 32 bit XP SP 3 platform

wrote a small profram to check some parameters;
Received the following Re: Signed abd unsigned iintegers

[quote]
int x = 0xAB78 in decimal format is : 43896
and
unsigned int y = 0xAB78 in decimal format is : 43896
The  size of int is 4 bytes
[/quote]


Not quite what I expected, sine the leftmost bit in 'int' is 1 and
would be the negative flag.

So wrote another for byte sizes and got the following -

[quote]
The  size of short int is 2 bytes
The  size of int is 4 bytes
The  size of long int is 4 bytes
The  size of double is 8 bytes
The  size of long double is 12 bytes
[/quote]

Note size of int and long int are the same both are 4 bytes long

Is this to be expected?

Thanks!

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-04-08  8:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-06  6:05 long_int vs int byte sizes Joseph Maxwell
2014-04-06  6:36 ` sisyphus1
2014-04-07  7:49   ` Csaba Raduly
2014-04-07  8:47   ` Corinna Vinschen
2014-04-07 14:16     ` Eric Blake
2014-04-07 14:42       ` Corinna Vinschen
2014-04-07 15:39         ` Eric Blake
2014-04-07 15:51           ` Corinna Vinschen
2014-04-07 23:41             ` Ross Smith
2014-04-08  8:48               ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).