I\'ve the following program:
#include int main() { int ch; while( ch = getchar() != \'\\n\') { printf(\"Read
C (and C++) interpret the while loop as:
while( ch = (getchar() != '\n')) {
So ch gets the value 1 (for true), which is an unprintable character. You should use explicit parenthesis to fix the precedence:
ch
1
while( (ch = getchar()) != '\n') {