GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Sunday, March 13, 2011

CPP - Reading A Whole File

#include <iostream>
#include <cstdlib>
#include <fstream>

using namespace std;

int main(int argc, char* argv[]){
    system("color 2f");

    ifstream infile("E:/lola/editor.html");

    if(infile.is_open()){
        while(!infile.eof()){
            string names;
            getline(infile, names);
            cout << names << endl;
        }
    }else{
        cout << "Sorry Cannot Open The File" << endl;
    }

    return 0;
}
Share/Bookmark

No comments:

Post a Comment