Below is a sample code
while ((c = getchar()) != EOF)
{
putchar(c);
}
I can understand most of the part but not that EOF (End of file).
Below is a sample code
while ((c = getchar()) != EOF)
{
putchar(c);
}
I can understand most of the part but not that EOF (End of file).
It's easy. The EOF
is a constant equal to -1
which is returned by getchar()
when the standard input has reached the and and cannot give you many more characters.