Does the ANSI C specification call for size of int to be equal to the word size (32 bit / 64 bit) of the system?
In other words, can I decipher the word size of the system based on the space allocated to an int?
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.
The size of the
inttype is implementation-dependent, but cannot be shorter than 16 bits. See theMinimum Type Limitssection here.This Linux kernel development site claims that the size of the
longtype is guaranteed to be the machine’s word size, but that statement is likely to be false: I couldn’t find any confirmation of that in the standard, andlongis only 32 bits wide on Win64 systems (since these systems use the LLP64 data model).