Error after compiling in visual studio (C2120: 'void' illegal with all types). New to c++, basically trying to make the program return an error if the file they enter does not exist. Any advice would help. Thanks!
#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
using namespace std;
int main()
{
string input_file_name;
cout << "Give name of input file : ";
cin >> input_file_name;
ifstream ins(input_file_name.c_str());
assert(ins);
if (assert(ins) == false)
cout << "Error: " << input_file_name << "does not exist";
}