State the output File Operation 1

/*
    State the output
*/
#include<iostream>
#include<fstream>
using namespace std;

int main()
{
    char data[100];
    ifstream ifile;

    ifile.open("text.txt");

    while(!ifile.eof())
    {
        ifile.getline(data,100);
        cout<<data<<endl;
    }

    ifile.close();
    return 0;
}

Previous
Next Post »