Cant open file

void atidarymas(string pav, char a)
{
bool skaityti=false;
string pav;
cout << "Enter file name: " << endl;
getline(cin, pav);

ifstream Open(pav);
if (!Open) //tikrina ar yra toks failas
{ cout << "Failed!\n"; }
else
{
char a;
cout << "Reading..." << endl;
while(!Open.eof()) //skaito kol baigsis
{
Open.get(a);
cout << a;
}
}
Open.close();
}
ifstream Open(pav.c_str());
Topic archived. No new replies allowed.