I want the following function to open a file which the name of the file is stored in file_name. However, when I tried to compile it, I received no matching function for call to 'std::basic_ifstream...... error. When I replaced the file_name with actual name of the file like "data.txt", it compiled without error. Could someone please help me out? I need the users to be able to type in the file name. Thanks in advance.
void retrieve_file(string file_name)
unsigned int input_index;
ifstream input_file (file_name);
""" """ """