Question

Is it right to say that the width of int data type depends on the data width of the ALU ? For example is it right to say that a 32-bit processor will have int data type as 32-bit wide? Similarly for 16 bit and 8 bit(please note that C guarantees that the size of int at least greater than 16 bit).

Was it helpful?

Solution

No, this is up to the implementation. For instance, many compilers for 64bit systems have 32bit wide ints still.

OTHER TIPS

You would probably have to refer to you compiler's documentation regarding the determination of the size of a primitive type since the details of primitive types and built-in operators such as sizeof would be compiler-specific. In the end it probably would be directly correlated to the details of the hardware, but I believe C is at a higher level of abstraction than concerning yourself with ALU details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top