Подскажите пожалуйста как через геттер собрать строку для вывода в файл. Метод должен возвращать значение типа std::string

void get_output_address()
{
    string path = "C:\\in.txt";

    ifstream fin;
    fin.open(path);
    if (fin.is_open()) {
        cout << "File was open :)" << endl;
        char ch;
        while (fin.get(ch))
        {
            cout << ch;

        }
    }
    else {
        cout << "!!!Error!!!  File not open!" << endl;
    }
    fin.close();

Ответы (0 шт):