fork(1) download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. std::iostream io (nullptr);
  6. io.std::ostream::rdbuf(std::cout.rdbuf());
  7. io.std::istream::rdbuf(std::cin.rdbuf());
  8. int x;
  9. io >> x;
  10. io << "Input was " << x << std::endl;
  11. }
  12.  
Success #stdin #stdout 0s 3340KB
stdin
7
stdout
Standard output is empty