Hi all,
a small confusion is there for me regarding the getc and fgetc functions. i have written this small program
Let us say i have input "qwmb" followed with [enter]. Then the output of the program is "qwmb" and the control would go to the new line. now my doubt is once you entered the input as q then what is the value the variable c is holding and if i enter w is the variable c not over written? if i press [enter] how does the variable c hold the complete value "qwmb"?Code:int main(int argc, char *argv[]) { int c; while((c = fgetc(stdin)) != EOF) { fputc(c,stdout); } return 0; }
could somebody please explain me this concept?
thanks in advance,
regards,
satya



LinkBack URL
About LinkBacks


