Research and learning

1969–1993

C: What Did Types Change?

Use a dated language-development account and a fictional memory layout to distinguish an element step from an address unit, without assuming universal sizes.

Original three-panel learning diagram accompanying the worked example.
1 unit
Invented char size
2 units
Initial invented int size

The short answer

Read the historical record, work through the invented example, then identify which conclusions depend on the example’s assumptions.

Read the distinctions

Count elements, then calculate displacement

Compare the kind of statement being made before treating two claims as equivalent.

Historical predicates and invented examples are distinguished in the article.
QuestionElement offsetDisplacement in the invented layout
Fourth char33 units
Fourth int, size 236 units
Fourth int, size 4312 units

Chronology

A timeline of the turning points

  1. Experimental transition

    Ritchie began adding a character type to B.

A development account, not a timeless specification

In his 1993 retrospective, Ritchie contrasts B’s word-oriented model with the byte-addressed PDP-11. His experimental NB added char and int, with pointer arithmetic scaled by the referred-to type. The account describes a design transition rather than prescribing one universal integer size.

The 1974 Unix paper independently dates the system’s C rewrite to summer 1973. A language’s design and an operating system’s implementation can influence each other without becoming the same object.

Sources for this section: [1] · [2]

Arrays required another decision

Ritchie explains that an early array representation stored a pointer cell. Embedding arrays in structures exposed difficulties. C’s solution instead created a pointer value when an array appeared in an expression, avoiding that extra stored cell.

This historical explanation is narrower than a complete language specification. It helps identify the problem being solved, but it does not licence assumptions about every expression, compiler, layout or later standard. The cited retrospective’s selected passage does not replace those documents.

Sources for this section: [1]

Invented layout and task

Define a teaching machine with numbered address units. A char occupies 1 unit and an int occupies 2 units. A four-element char array starts at 100; a four-element int array starts at 200. Both arrays are contiguous. Define an element step as the size of the pointed-to element, with no padding between array elements. These sizes and addresses are invented.

Find the address of the fourth element in each array, counting the first as element 0. Then explain why adding the same element offset need not add the same number of address units. Finally, change the stipulated int size to 4 units while retaining its starting address. What changes and what remains the same?

Sources for this section: [1]

Reference answer

For the char array, offset 3 gives 100+3×1=103. For the int array, it gives 200+3×2=206. The index is 3 in both cases; the address displacement is 3 units in one case and 6 in the other. Under the revised size, the int address becomes 200+3×4=212. The fourth element is still the element with index 3.

All calculations follow the fixture’s definition of element steps. They do not establish the size of int on any real machine. Nor does the example show that a program using implementation-specific layouts will become portable merely by being written in C. A representation claim requires its own assumptions.

Sources for this section: [1]

Continue the chronology

Biography context

Explore United States through connected lives

Connected biographies

People behind the records

Quick answers

Common questions

Is int always two address units?
No. That is an explicit input to the first fictional layout, and the second layout deliberately changes it.

Primary and institutional sources

How this history was checked

The cited records have different dates and purposes. All worked examples are newly invented and are not historical measurements. This article was reviewed on 31 October 2026.

  1. Dennis M. Ritchie; ACM HOPL-II, 1993The Development of the C Language
  2. Dennis M. Ritchie and Ken Thompson; Communications of the ACM 17(7), July 1974The UNIX Time-Sharing System