fork(3) download
  1. #include <cstdio>
  2. #include <iostream>
  3.  
  4. int main() {
  5. using namespace std;
  6.  
  7. char ch;
  8. cin >> ch;
  9.  
  10. cin.clear();
  11.  
  12. cout << boolalpha
  13. << "feof(stdin): " << bool(feof(stdin)) << endl
  14. << "cin.eof(): " << cin.eof() << endl;
  15. }
Success #stdin #stdout 0s 4356KB
stdin
Standard input is empty
stdout
feof(stdin): true
cin.eof(): false