Hello, i have this code in my c++ program : ifstream myfile("lala.txt");
I want my code to allow the user to enter a file name ( string fname ). However when i use the code like this ( ifstream myFile(fname); ), i recieved compiler errors. Is there any proper way of doing this ?
Question
Nerf
Hello, i have this code in my c++ program : ifstream myfile("lala.txt");
I want my code to allow the user to enter a file name ( string fname ). However when i use the code like this ( ifstream myFile(fname); ), i recieved compiler errors. Is there any proper way of doing this ?
Thanks in advanced.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts