Need help with programming assignment!!

Hey guys, i am having trouble finishing my program. Here's the program. I am getting an error saying my 'fin' is not declared. I also need to include a loop to allow the user to enter the file name twice before exiting if the file does not exist that they entered. Here is my program that i have typed up so far. If anyone has any answers that would be great. Thanks!

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

void showContent(fstream &);

int main(void)
string fileName;
char line[100];
fstream fin;
fstream dataFile;

cout << "Please enter the Filename: " << endl;
cin >> fileName;, ios::in);


cout << "Error Opening File! Re-enter File Name: " << endl;
cin >> fileName;


void showContent(fstream &file)
int counter = 0;
char getch();

if (counter > 21)
counter = 0;

fin.getline(line, 101, '\n');
cout << line << endl;
Instead of fstream fin; it should be ifstream fin;
@fiji885 it still says 'fin' is not declared
fin is not declared in function showContent. You need to rename the argument "file" as "fin".
Don't create a second post for just the same topic.
I need to include a loop in this program where if the user enters the wrong file name, it allows the user to enter it two more times before exiting.
Have a look here, seems the same problem:
Topic archived. No new replies allowed.