All right so I need to use infile to open the file the user inputs.

For example:

Enter file name: Program.txt

I need to be able to open program.txt or any other program name the user inputs and if the file doesnt exist then my program should output an error message.
The code i have for it is

#include <iostream>
#include <fstream>
#include <iomanip>

char name[81]
ifstream infile;
inFile.open(name);
if(inFile.fail)
cout << "Cant find file";

I get an error at inFile.open(name) saying infil hasnt been declared. I thought using the #include <fstream> at the top allowed me to use it. Any help on this would be nice.