Wouldn’t it have made more sense to make long 64-bit and reserve long long until 128-bit numbers become a reality?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, it does make sense, but Microsoft had their own reasons for defining “long” as 32-bits.
As far as I know, of all the mainstream systems right now, Windows is the only OS where “long” is 32-bits. On Unix and Linux, it’s 64-bit.
All compilers for Windows will compile “long” to 32-bits on Windows to maintain compatibility with Microsoft.
For this reason, I avoid using “int” and “long”. Occasionally I’ll use “int” for error codes and booleans (in C), but I never use them for any code that is dependent on the size of the type.