Erik de Castro Lopo wrote:
Please do not CC me on replies. I am subscribed to the list.
O Plameras wrote:
So what is the reasoning why the int are still 4 bytes instead of 8 bytes ?
Can anyone clarify ?
There are a whole bunch of things in programs where a 32 bit integer
is sufficient and 64 bits is complete overkill. The first example that
comes to mind is counters used in for loops, or array indexing. For
most of these cases, using a 32 bit integer will be faster than using
a 64 bit integer (mainly because of memory bandwidth when the register
is loaded from or stored to dram).
In addition, C is used for low level programming where the programmer
needs to be able to address 32 bit hardware registers. If int was
32 bits, what would you use for accessing these registers.
Many books in C programming teaches that 64-bit machines have 8 bytes
int size,
at least the ones I gone through. I have not gone through your book
that you
co-authored. Did you or your book say anything about int sizes in
relation to
machine architecture ? And what did you say there ? I'm curious ?
Thanks.
O Plameras
http://www.acay.com.au/~oscarp/tutor
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html