C++ ifstream create
#include <iostream> #include <fstream> #include <string> using namespace std; int main() // ww w . j av a2 s.co m { string word; ifstream infile("../MyFile.txt"); infile >> word; cout << word << endl; infile.close(); return 0; }