Search code examples
cinteger-promotion

The width of int data type on a machine


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).


Solution

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