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;;
cout << "Cant find file";

I get an error at 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.