Program to read from text file and display it

Home Forums C++ Program to read from text file and display it

This topic contains 0 replies, has 1 voice, and was last updated by  admin 7 months, 4 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #5243

    admin
    Keymaster

    //Program to read from text file and display it

    #include <iostream>
    #include <fstream.h>
    using namespace std;

    int main()
    {
    ifstream fin;
    fin.open(“out.txt”);

    char ch;

    while(!fin.eof())
    {
    fin.get(ch);
    cout << ch;
    }

    fin.close();
    return 0;
    }

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.