Input a file and output some data

Hello everyone, I got an assignment that i have to use the code to input a file (which can be .txt or anything, and there are some data in .txt).I have to enter the file name. and then it will print the data in the .exe. I know how to input the file right now, but i do not know how to scan the data and print it out. Hope someone can help me. Thanks
1
2
3
4
5
6
    if (myReadFile.is_open()) 
    {
          while(!myReadFile.eof())
          {
          getline(myReadFile,line);
          cout << line << endl;
Last edited on
Topic archived. No new replies allowed.