|
From: | Juergen Sauermann |
Subject: | Re: [Bug-apl] Is this output incorrect? |
Date: | Sun, 01 Jun 2014 14:00:30 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 |
Hi Peter,
almost correct. The first comment should be "// may point to an optional string typically containing 6 spaces". prompt can be 0 and then no prompt is printed. Otherwise the function pushes the prompt (backwards) back into stdin. Whether that works is a matter of the underlying operating system. The man page of ungetc() says that only 1 ungetc() char is guaranteed but we push 6. Another question is whether an ungetc() into stdin will occur on C++ cin? The main use case for this were scripts where it does not matter too much if a prompt is printed or not. Note also that pushing chars back into stdin has a different effect than just printing the prompt - there are cases where the prompt should be editable (⍞ I believe). /// Jürgen On 06/01/2014 04:22 AM, Peter Teeson wrote: Hi Jürgen: |
[Prev in Thread] | Current Thread | [Next in Thread] |