Back to all stories

The design of C's integer types, which allows for flexible sizes, was not a mistake but rather a deliberate choice to achieve portability across various computer architectures. In the past, computers had unusual word sizes, such as 12, 18, 36, and 60 bits, and C's flexible integer types enabled the language to adapt to these different systems. This is evident when using the `sizeof` operator, which can return different values for the size of an `int` depending on the machine, such as 2 bytes on an old 386 machine or 4 bytes on most modern machines, highlighting that native C integer types do not have a fixed size.