Size of Integer , long Integer, Long double

S

Suresh V

I did a small analysis of getting size of each of these data types

Types 16-bit 32-bit 64-bit
int 2 4 4
long int 4 4 8
long double 10 12 16

Numbers are in bytes.

how the size of an integer is decided?

Is it based on processor or compiler or OS? If so why can't it be
constant across all platforms

Please clear my doubt.

+suresh
 
I

Ian Collins

I did a small analysis of getting size of each of these data types

Types 16-bit 32-bit 64-bit
int 2 4 4
long int 4 4 8
long double 10 12 16

Numbers are in bytes.

how the size of an integer is decided?

Is it based on processor or compiler or OS?

Generally by the OS (based on the CPU type). A decent (if biased)
overview of common memory models can be found here:

http://www.unix.org/version2/whatsnew/lp64_wp.html
If so why can't it be constant across all platforms

We live in an imperfect world!
Please clear my doubt.

Which is?
 
J

Juha Nieminen

Suresh V said:
Types 16-bit 32-bit 64-bit
int 2 4 4
long int 4 4 8
long double 10 12 16

Completely off-topic, but I'm curious to know why you assume that
everybody is using the exact same variable-width font as you are.

(Generally speaking, if you want to use any kind of formatting in usenet
news, the only safe assumption you can make is to use a fixed-width font.)
 
S

Suresh V

I don't see any way to create table in usenet so used my own variable-
width font.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top