Hi, I am learning C by working through K&R using Dev-C++ under windows. Some of the examples have something like
while((c = getchar()) != EOF)
to get the input. But I had a problem. Since it takes input from my keyboard... how do I end the input so that I can see the rest of the program run? I did the exercise that had me find the value of the EOF and it showed me -1 but how do I type in a character that has a value of -1? Am I not supposed to be inputting with my keyboard?
while((c = getchar()) != EOF)
to get the input. But I had a problem. Since it takes input from my keyboard... how do I end the input so that I can see the rest of the program run? I did the exercise that had me find the value of the EOF and it showed me -1 but how do I type in a character that has a value of -1? Am I not supposed to be inputting with my keyboard?
Comment