Answers for "how to input multiple lines of a file in c++"

C++
-2

how to input multiple lines of a file in c++

#include <iostream>
#include <fstream>
#include <sstream>
#include <string>

using namespace std;

int main()
{
    
    ifstream in("file.txt");
    stringstream sstr;
    while(in >> sstr.rdbuf());
    cout << sstr.str() << endl;



    return 0;
}
Posted by: Guest on March-11-2020

Code answers related to "how to input multiple lines of a file in c++"

Browse Popular Code Answers by Language