fork download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <fstream>
  4.  
  5. int main()
  6. {
  7. std::ifstream input("file.txt");
  8. std::stringstream sstr;
  9.  
  10. while(input >> sstr.rdbuf());
  11.  
  12. std::cout << sstr.str() << std::endl;
  13. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout