Why int in C does not mean 32 bits, and a byte is not always 8 bits

This article explores the historical reasons why the C language standard does not define a fixed size for data types like int or byte. The author explains that in the 1970s, computer architectures were extremely diverse, and the language creators aimed to ensure maximum code portability across different systems, including machines with 16-bit or 36-bit words. The material covers the evolution of these concepts from the origins of C to the modern C23 standard. Although sizeof(int) most often returns 4 today, the lack of a strict bit-count binding is a deliberate architectural decision rather than a design flaw. The article invites readers to delve into the history of computing to understand why these language features remain relevant today, providing flexibility when working with diverse hardware.
This is a summary. Read the full article at the original source:
HabrRelated stories
Java 24 removes synchronized pinning. Why are virtual threads still slow?
Java 24 has introduced a significant change: virtual threads no longer pin carrier threads within synchronized blocks. This eliminates a critical perf…
This article on Habr provides a practical perspective on building robust error handling and alerting systems within Enterprise Service Bus (ESB) integ…
200 OK, but the client sees an empty chat: the second silence bug in an n8n AI agent
In this article, the author analyzes a technical issue encountered while operating an AI agent on the n8n platform. Although all nodes in the workflow…



