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