- #1
Ja4Coltrane
- 225
- 0
Hello.
So I am trying to write a simple copy program. For whatever reason, the program will never stop running! Even if I directly enter the value of EOF (-1 in my case), it still goes.
So I am trying to write a simple copy program. For whatever reason, the program will never stop running! Even if I directly enter the value of EOF (-1 in my case), it still goes.
Code:
#include <stdio.h>
main()
{
int c;
c = getchar();
while ( c != EOF) {
putchar(c);
c = getchar();
}
}