Check out example codes for "how to input multiple lines of a file in c++". It will help you in understanding the concepts better.

Code Example 1

#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;
}

Learn ReactJs, React Native from akashmittal.com