C++ Text File Read

Description

C++ Text File Read

#include <iostream> 
#include <fstream> 
#include <string> 

using namespace std; 

int main() /*from   w  w w.  j a  v  a 2s .  co m*/
{ 
    string word; 
    ifstream infile("../MyFile.txt"); 
    infile >> word; 
    cout << word << endl; 
    infile.close(); 

    return 0; 
}



PreviousNext

Related