Default said:
You'll notice that I specified c to be int. There's a reason for that,
get() returns an int. The reason that it returns an int is that EOF is
a negative value (often -1 but not required). The char type may or may
not be signed.
I don't know exactly what you mean. What did you enter?
I enter a stream, for example, "aabbbbaaa" and a carriage return. I
think '\n' is from the carriage return. When the second time the
while() loop is run, I enter another stream. But the '\n' is already
read, so c='\n'. Am I right? How to get rid of the '\n'?
Anothe thing is that I enter a stream, "aabbbbaaa". Only after I enter
the carriage return, the while loop start to process the stream char by
char. Where is the stream stored before entering the while loop? in a
buffer?
Is it possible that when I am typing the stream, "aabbbbaaa", the code
processes the char one by one untill I enter a carriage return?