Hi, i have a problem using getchar:
It prints "hello" twice, because i think it sees the '\n' character.Code:#include <stdio.h> int main () { int c; char a = 'a'; while ( (c = getchar()) != a ) { printf("hello"); } }
??
Hi, i have a problem using getchar:
It prints "hello" twice, because i think it sees the '\n' character.Code:#include <stdio.h> int main () { int c; char a = 'a'; while ( (c = getchar()) != a ) { printf("hello"); } }
??