Any way to prevent readline() from echoing back characters?


#1

The code in page 62 using readline() function works, but in the console window, the characters I typed was echoed back. SO what I see from the console was actually like so:

who is cool? MMiikkeeyy
Mikey is cool!

Although the program is behaving perfectly, I am just wondering if there a way to suppress the echoing back. I think this feature is slightly annoying and confusing to the user.

Thanks in advance. CJ


#2

I’m having the same issue. Any help would be greatly appreciated.


#3

I would also like to know why this happens?


#4

Explanation found on page 63.


#5

Page 63 doesn’t help much on a Kindle… :confused: I assume you are referring to this:

[quote]Note that Xcode has an interesting behavior when using the readline function. It will duplicate text input as output:

Figure 8.3 readline() output

This is expected behavior in Xcode.
[/quote]

I think this is one of those “you don’t need to know more than this” moments. I’m assuming that when we get to real apps, we won’t be using readline() anymore.