friends, i am new to C. I learnt today about getchar() and putchar() functions and calling them. The book (by Denis Ritchie) says that getchar reads one character at a time and putchar prints a character each time it is called. but in practice, when I input a long character string instead of just one character, it accepted and putchar printed that exact string. I am missing the point. could you please help me?
thanks in advance..Code:#include <stdio.h> main() { int c; c = getchar(); while (c!=EOF) { putchar(c); c = getchar(); } }