Answers for "finding word in file in 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 "finding word in file in c++"

Browse Popular Code Answers by Language