Can I ignore getting end-of-file in C?

I found nothing about this online.

I am trying to make a program that asks a user for input. I already know how to terminate the program after getting EOF.

if(feof(stdin)) exit(1);

Or,

while(!feof(stdin)) { ... }


Read more here: https://stackoverflow.com/questions/67014854/can-i-ignore-getting-end-of-file-in-c

Content Attribution

This content was originally published by meaj-gnu-linux at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: