how to get a word from file c 2b 2b

Solutions on MaxInterview for how to get a word from file c 2b 2b by the best coders in the world

showing results for - "how to get a word from file c 2b 2b"
Eleonora
30 Jul 2019
1void readFile()
2{
3    ifstream file;
4    file.open ("program.txt");
5    if (!file.is_open()) return;
6
7    string word;
8    while (file >> word)
9    {
10        cout<< word << '\n';
11    }
12}
13