V
V
Vadim Chorrny2020-10-30 18:41:18
C++ / C#
Vadim Chorrny, 2020-10-30 18:41:18

How to display text from a C++ file on button click?

Hello!
I started learning how to work with files in C++ and ran into a problem with text output.
My code:

ifstream fin;
    fin.open("myFile.txt");

    string arr_char;

    for (int i = 0; fin.eof() == false ; i++)
    {
        fin >> arr_char;
        cout << arr_char << endl;
    }


Question: how to display one word from a file by pressing the enter button?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question