<div dir="ltr">On Thu, Oct 27, 2011 at 10:48, Rustom Mody <span dir="ltr"><<a href="mailto:rustompmody@gmail.com">rustompmody@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Can someone explain what is happening here?<br>
*Main> getTwoChars<br>ab<br>('a','b')<br>*Main> getTwoChars<br>a<br>('\n','a')<br></blockquote><div><br></div><div>The code is doing exactly what it says. getTwoChars reads two characters --- *not* a line. So the next character waiting to be read is the newline, which is returned by the next getTwoChars.</div>
<div><br></div><div>This may depend to some extent on the platform, as Unix defaults to a line-oriented input interface (at the OS level) but Windows to character-oriented input.</div></div><div><br></div>-- <br>brandon s allbery <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>
wandering unix systems administrator (available) (412) 475-9364 vm/sms<br><br>
</div>