int x; string word; ofstream outFile; ifstream inFile;
ifstream dataFile; string fileName = "hello.info" dataFile.open(fileName)
ifstream dataFile; string fileName = "hello.info" dataFile.open(fileName.c_str())
ifstream inFile inFile.open(fileName.c_str()) if (!inFile) { cout << "Failed to open " << fileName << endl; }
string word; ifstream inFile; ... inFile >> word while(inFile) { // process word inFile >> word }