ProgrammingHard

A circular buffer of capacity 4 holds 3 items and is written with 2 more. How many items are in it afterwards if the buffer overwrites the oldest?

  1. A. 5
  2. B. 3
  3. C. 4
  4. D. 2

Correct answer: C. 4

The buffer is full at 4 items, and each extra write beyond capacity overwrites the oldest, so it stays at 4.

More C Programming questions

Exams that ask this topic