- #1
physics kiddy
- 135
- 1
Can anyone please explain what is EOF in C programming language.
Is it a value (numeric, character) or something else ??
While reading the book "The C programming language", by Ritchie I came across this term. The code was :
#include <stdio.h>
/* copy input to output; 1st version */
main()
{
int c;
c = getchar();
while (c != EOF) {
putchar(c);
c = getchar();
}
}
Please, please explain. I am just a beginner in C programming language, not an expert. So please give an explanation I can understand ...
Is it a value (numeric, character) or something else ??
While reading the book "The C programming language", by Ritchie I came across this term. The code was :
#include <stdio.h>
/* copy input to output; 1st version */
main()
{
int c;
c = getchar();
while (c != EOF) {
putchar(c);
c = getchar();
}
}
Please, please explain. I am just a beginner in C programming language, not an expert. So please give an explanation I can understand ...