функция с istream и параметром C ++

Я хотел бы, чтобы моя программа прочитала файл, используя функцию "ReadFile» ниже. Я пытаюсь выяснить, как вызвать функцию с помощью istream & параметр. Цель функции - прочитать файл, получив егоимя в качестве параметра.

#include 
#include 
#include 
#include 
using namespace std;

bool readFile(std::istream& fileName); //error 1 this line

int main(void)
{   
    string fileName;

    cout < "Enter the file name: ";
    cin >> fileName;

    readFile(fileName); //error 2 this line


}

bool readFile(std::istream& fileName)
{
    ifstream file(fileName, ios::in); //error 3 this line
    return true;
}

Ответы на вопрос(1)

Ваш ответ на вопрос