[1+1=2]
OneAndOneIs2

Fri, May 02, 2008

[Link][Icon]K&R's reverse Polish notation calculator

Section 4.3, pages 76-78

I realise that this is a long shot, but: Can anyone tell me why the buffer used by getch() and ungetch() is an array of 100 chars?

Because no matter how I follow the logic, I can't see any way that you'll ever have more than one char going into the buffer: getop() only puts a maximum of one char into the buffer at the end of its run, and the first thing it does when it's called is to take a char from the buffer if there is one.

Am I missing something, or is this array here for future-proof flexibility or something?

2 comments • Categories: Omni, Programming

Categories

May 2008
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Search

Misc

XML Feeds

What is this?
eXTReMe Tracker

Valid XHTML 1.0 Transitional

Valid CSS!

[Valid RSS feed]

powered by
b2evolution

blank