Does the size of an int depend on the compiler and/or processor?

前端 未结 10 1317
借酒劲吻你
借酒劲吻你 2020-11-22 11:58

Would the size of an integer depend upon the compiler, OS and processor?

10条回答
  •  渐次进展
    2020-11-22 12:54

    Size of the int is equal to the word-length that depends upon the underlying ISA. Processor is just the hardware implementation of the ISA and the compiler is just the software-side implementation of the ISA. Everything revolves around the underlying ISA. Most popular ISA is Intel's IA-32 these days. it has a word length of 32bits or 4bytes. 4 bytes could be the max size of 'int' (just plain int, not short or long) compilers. based on IA-32, could use.

提交回复
热议问题