int bigger than long int?

Calin

Diamond Member
Apr 9, 2001
3,112
0
0
As I know, the int data type in C have a width equal to the width of processor (well, and operating system). So, a int is 16 bit on a 286, and 32 bit on a 386.
Unlike this, the long int has a width of 32 bits, independent of architecture.
My question is: On a Athlon XP (or Intel Itanium) running a 64-bit operating system the int data type is 64 bits wide, and long int is only 32 bits wide?

Calin
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
First, Athlon XP's aren't 64-bit.

Second, Usually 64-bit systems will have long and int both be 32-bits for compatibility reasons, but you should never assume that. You'll have to check the documentation for each architecture you plan on supporting.
 

Calin

Diamond Member
Apr 9, 2001
3,112
0
0
Yes, I only now realize that. I wanted to refer to the new 64-bit architecture of AMD, the Opteron (I think this was called)
And I know in M$ Visual C++, there is a __int64 data type (64-bit wide), for explicit use of 64-bit values

Thanks
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Yes, I only now realize that. I wanted to refer to the new 64-bit architecture of AMD, the Opteron (I think this was called)

IIRC the server version will be called Opteron and the workstation one will just be Athlon64.

And I know in M$ Visual C++, there is a __int64 data type (64-bit wide), for explicit use of 64-bit values

Refer to a similar discussion here

Not to 'advertise' for other forums, but the Arstechnica Programmer's Symposium is a great resource for programming questions, there's many professional (and non-professional but just really good) programmers there.
 

ASK THE COMMUNITY