English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm attempting to write a program where part of it is to open a file, read a file, add to file, save file, etc. For each of these we need to make seperate functions. In my function for opening a file, I keep hitting a compiling wall that says my parameters are clashing with the line ifstream fin;
My problem is that I cannot for the life of me figure out how to get it to work. Here's the piece of code I have so any help would be amazing!

int openFile(ifstream &fin)
{
char filename[25];
cout << "Please input the file name.\n";
ifstream fin;
cin >> filename;
fin.open(filename);
cout << "File is loaded.\n";

return 0;
}

2007-10-28 00:49:37 · 1 answers · asked by volleyballdawl 2 in Computers & Internet Programming & Design

1 answers

I actually saw the function and it seems correctly written.
Please check if the file which should be opened is available…

2007-10-28 02:04:44 · answer #1 · answered by Mag 7 · 0 0

fedest.com, questions and answers