A few paragraphs after the discussion of getop()
, the book has this to say about the ungetch()
implementation (emphasis added):
The standard library includes a function
ungetch
that provides one character of pushback; we will discuss it in Chapter 7. We have used an array for the pushback, rather than a single character, to illustrate a more general approach.