Answers for "how to get a word from file c++"

C++
0

how to get a word from file c++

void readFile()
{
    ifstream file;
    file.open ("program.txt");
    if (!file.is_open()) return;

    string word;
    while (file >> word)
    {
        cout<< word << '\n';
    }
}
Posted by: Guest on June-16-2021

Code answers related to "how to get a word from file c++"

Browse Popular Code Answers by Language